Added treesitter-context-commentstring, vue SFC support and theme preview
parent
19457c1f36
commit
295cc63bcd
22
README.md
22
README.md
|
|
@ -12,17 +12,12 @@ sudo apt install gcc ripgrep unzip java-common default-jre luarocks cmake libbin
|
||||||
|
|
||||||
## Language servers:
|
## Language servers:
|
||||||
|
|
||||||
|
See `lua/lsp.lua` for the commented out MasonInstall commands
|
||||||
|
|
||||||
|
## Treesitter parsers
|
||||||
|
|
||||||
```
|
```
|
||||||
:MasonInstall clangd
|
:TSInstall javascript typescript jsx tsx vue html css
|
||||||
:MasonInstall lua-language-server@3.15.0
|
|
||||||
:MasonInstall luacheck
|
|
||||||
:MasonInstall rust-analyzer
|
|
||||||
:MasonInstall shellcheck
|
|
||||||
:MasonInstall vtsls
|
|
||||||
:MasonInstall vue-language-server
|
|
||||||
:MasonInstall yaml-language-server
|
|
||||||
:MasonInstall css-lsp
|
|
||||||
:MasonInstall docker-langauge-server
|
|
||||||
```
|
```
|
||||||
|
|
||||||
To get vue working:
|
To get vue working:
|
||||||
|
|
@ -33,3 +28,10 @@ npm install -g @vtsls/language-server
|
||||||
## NerdFont
|
## NerdFont
|
||||||
|
|
||||||
A NerdFont with symbols is required to show icons in tree view
|
A NerdFont with symbols is required to show icons in tree view
|
||||||
|
|
||||||
|
## Nice to know stuff
|
||||||
|
|
||||||
|
### `:InspectTree`
|
||||||
|
- Debug the treesitter syntax tree
|
||||||
|
- 'I' to display the assumed source language
|
||||||
|
- 'a' to toggle anonymous nodes
|
||||||
|
|
|
||||||
9
init.lua
9
init.lua
|
|
@ -4,6 +4,7 @@ require 'spec'
|
||||||
spec 'plugin/colorscheme'
|
spec 'plugin/colorscheme'
|
||||||
spec 'plugin/treesitter'
|
spec 'plugin/treesitter'
|
||||||
spec 'plugin/treesitter-context'
|
spec 'plugin/treesitter-context'
|
||||||
|
-- spec 'plugin/treesitter-context-commentstring'
|
||||||
spec 'plugin/bookmarks'
|
spec 'plugin/bookmarks'
|
||||||
spec 'plugin/telescope-bookmarks'
|
spec 'plugin/telescope-bookmarks'
|
||||||
spec 'plugin/telescope-ui-select'
|
spec 'plugin/telescope-ui-select'
|
||||||
|
|
@ -28,3 +29,11 @@ require 'plugin/lazy'
|
||||||
require 'lsp'
|
require 'lsp'
|
||||||
require 'scripts'
|
require 'scripts'
|
||||||
require 'keymap'
|
require 'keymap'
|
||||||
|
|
||||||
|
-- Temporary, find out how to fix
|
||||||
|
vim.api.nvim_create_autocmd( 'FileType', { pattern = 'vue',
|
||||||
|
callback = function(ev)
|
||||||
|
vim.treesitter.start(ev.buf, 'vue')
|
||||||
|
-- vim.bo[ev.buf].syntax = 'ON' -- only if additional legacy syntax is needed
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
|
||||||
|
|
@ -6,27 +6,28 @@
|
||||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||||
"copilot.vim": { "branch": "release", "commit": "a12fd5672110c8aa7e3c8419e28c96943ca179be" },
|
"copilot.vim": { "branch": "release", "commit": "a12fd5672110c8aa7e3c8419e28c96943ca179be" },
|
||||||
"edge": { "branch": "master", "commit": "7ec78c21bd8f0b2b0b47043bb1e730c561647c72" },
|
"edge": { "branch": "master", "commit": "7ec78c21bd8f0b2b0b47043bb1e730c561647c72" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "5c569562d9f9c98f12d684de5f37150e0ca1b12d" },
|
"gitsigns.nvim": { "branch": "main", "commit": "0f00d07c2c3106ba6abd594ac1c17f211141b7b5" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
"lspkind.nvim": { "branch": "master", "commit": "c7274c48137396526b59d86232eabcdc7fed8a32" },
|
"lspkind.nvim": { "branch": "master", "commit": "c7274c48137396526b59d86232eabcdc7fed8a32" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "a979821a975897b88493843301950c456a725982" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "25f609e7fca78af7cede4f9fa3af8a94b1c4950b" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
|
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
|
"nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "841c6d4139aedb8a3f2baf30cef5327371385b93" },
|
"nvim-lspconfig": { "branch": "master", "commit": "8e2084bf5e40c79c1f42210a6ef96a0a4793a763" },
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "3d385d3346e4883d60dc37cf642bd47bed78a46e" },
|
"nvim-tree.lua": { "branch": "master", "commit": "02ccbcd4af9a7fa159251f721d763c0d16f91703" },
|
||||||
"nvim-treesitter": { "branch": "main", "commit": "6620ae1c44dfa8623b22d0cbf873a9e8d073b849" },
|
"nvim-treesitter": { "branch": "main", "commit": "7caec274fd19c12b55902a5b795100d21531391f" },
|
||||||
"nvim-treesitter-context": { "branch": "master", "commit": "adf4b6b0420b7be6c717ef0ac7993183d6c201b1" },
|
"nvim-treesitter-context": { "branch": "master", "commit": "adf4b6b0420b7be6c717ef0ac7993183d6c201b1" },
|
||||||
|
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" },
|
"nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" },
|
||||||
"oxocarbon.nvim": { "branch": "main", "commit": "a7ba74849a00546a311f8c146320b433900393e7" },
|
"oxocarbon.nvim": { "branch": "main", "commit": "a7ba74849a00546a311f8c146320b433900393e7" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||||
"telescope-vim-bookmarks.nvim": { "branch": "main", "commit": "09a61043496bd9c4240955f7532ff2ae8fe3a905" },
|
"telescope-vim-bookmarks.nvim": { "branch": "main", "commit": "09a61043496bd9c4240955f7532ff2ae8fe3a905" },
|
||||||
"telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" },
|
"telescope.nvim": { "branch": "master", "commit": "cfb85dcf7f822b79224e9e6aef9e8c794211b20b" },
|
||||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||||
"toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" },
|
"toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" },
|
||||||
"tokyonight.nvim": { "branch": "main", "commit": "73822773d5badaeba999206179a9105f9867ac59" },
|
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },
|
||||||
"vim-bookmarks": { "branch": "master", "commit": "9cc5fa7ecc23b052bd524d07c85356c64b92aeef" },
|
"vim-bookmarks": { "branch": "master", "commit": "9cc5fa7ecc23b052bd524d07c85356c64b92aeef" },
|
||||||
"vim-smartword": { "branch": "master", "commit": "608d4883bb1eff4131f44857a21119220e55886d" },
|
"vim-smartword": { "branch": "master", "commit": "608d4883bb1eff4131f44857a21119220e55886d" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||||
|
|
|
||||||
17
lua/lsp.lua
17
lua/lsp.lua
|
|
@ -12,3 +12,20 @@ enable 'vue_ls'
|
||||||
enable 'clangd'
|
enable 'clangd'
|
||||||
enable 'docker_language_server'
|
enable 'docker_language_server'
|
||||||
enable 'cssls'
|
enable 'cssls'
|
||||||
|
enable 'emmet_language_server'
|
||||||
|
|
||||||
|
-- Comment these out to install the required language servers.
|
||||||
|
-- Remember to comment them after installation
|
||||||
|
-- vim.cmd [[
|
||||||
|
-- MasonInstall clangd
|
||||||
|
-- MasonInstall lua-language-server@3.15.0
|
||||||
|
-- MasonInstall luacheck
|
||||||
|
-- MasonInstall rust-analyzer
|
||||||
|
-- MasonInstall shellcheck
|
||||||
|
-- MasonInstall vtsls
|
||||||
|
-- MasonInstall vue-language-server
|
||||||
|
-- MasonInstall yaml-language-server
|
||||||
|
-- MasonInstall css-lsp
|
||||||
|
-- MasonInstall docker-language-server
|
||||||
|
-- MasonInstall emmet-language-server
|
||||||
|
-- ]]
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ local M = {
|
||||||
|
|
||||||
M.config = function()
|
M.config = function()
|
||||||
vim.opt.background =
|
vim.opt.background =
|
||||||
'light'
|
-- 'light'
|
||||||
-- 'dark'
|
'dark'
|
||||||
|
|
||||||
vim.cmd.colorscheme
|
vim.cmd.colorscheme
|
||||||
-- 'tokyonight'
|
-- 'tokyonight'
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,16 @@ function M.config()
|
||||||
['<esc>'] = actions.close,
|
['<esc>'] = actions.close,
|
||||||
['q'] = actions.close,
|
['q'] = actions.close,
|
||||||
},
|
},
|
||||||
|
i = {
|
||||||
|
['<c-down>'] = actions.move_selection_next,
|
||||||
|
['<c-up>'] = actions.move_selection_previous,
|
||||||
|
['<c-right>'] = function()
|
||||||
|
vim.api.nvim_set_option_value('background', 'light', {})
|
||||||
|
end,
|
||||||
|
['<c-left>'] = function()
|
||||||
|
vim.api.nvim_set_option_value('background', 'dark', {})
|
||||||
|
end,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
pickers = {
|
pickers = {
|
||||||
|
|
@ -68,15 +78,19 @@ M.keymap = function()
|
||||||
{ desc = 'Find word under cursor' })
|
{ desc = 'Find word under cursor' })
|
||||||
vim.keymap.set('v', '<s-f>', builtin.grep_string, { desc = 'Find visual selection' })
|
vim.keymap.set('v', '<s-f>', builtin.grep_string, { desc = 'Find visual selection' })
|
||||||
vim.keymap.set('n', '<leader>st', builtin.live_grep, { desc = 'Search for text in files' })
|
vim.keymap.set('n', '<leader>st', builtin.live_grep, { desc = 'Search for text in files' })
|
||||||
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = 'List diagnostics' })
|
vim.keymap.set('n', '<leader>ld', builtin.diagnostics, { desc = 'List diagnostics' })
|
||||||
|
vim.keymap.set('n', '<leader>lp', function() builtin.colorscheme { enable_preview = true } end,
|
||||||
|
{ desc = 'Preview colorschemes' })
|
||||||
vim.keymap.set('n', '<leader>o', builtin.lsp_document_symbols, { desc = 'List document symbols' })
|
vim.keymap.set('n', '<leader>o', builtin.lsp_document_symbols, { desc = 'List document symbols' })
|
||||||
vim.keymap.set('n', '<leader>p', builtin.lsp_workspace_symbols, { desc = 'List workspace symbols' })
|
vim.keymap.set('n', '<leader>p', builtin.lsp_workspace_symbols, { desc = 'List workspace symbols' })
|
||||||
vim.keymap.set('n', '<leader>gb', builtin.git_branches, { desc = 'List git branches' })
|
vim.keymap.set('n', '<leader>gb', builtin.git_branches, { desc = 'List git branches' })
|
||||||
vim.keymap.set('n', '<leader>gc', builtin.git_commits, { desc = 'List git commits' })
|
vim.keymap.set('n', '<leader>gc', builtin.git_commits, { desc = 'List git commits' })
|
||||||
vim.keymap.set('n', '<m-q>', function() builtin.git_status {
|
vim.keymap.set('n', '<m-q>', function()
|
||||||
|
builtin.git_status {
|
||||||
max_results = 10000,
|
max_results = 10000,
|
||||||
temp__scrolling_limit = 10000,
|
temp__scrolling_limit = 10000,
|
||||||
} end, { desc = 'Git status' })
|
}
|
||||||
|
end, { desc = 'Git status' })
|
||||||
vim.keymap.set('n', 'ma', bookmarks.all, { desc = 'List bookmarks' })
|
vim.keymap.set('n', 'ma', bookmarks.all, { desc = 'List bookmarks' })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
local M = {
|
||||||
|
'JoosepAlviste/nvim-ts-context-commentstring',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
},
|
||||||
|
opts = {},
|
||||||
|
}
|
||||||
|
|
||||||
|
M.config = function()
|
||||||
|
-- vim.g.skip_ts_context_commentstring_module = true
|
||||||
|
require 'ts_context_commentstring'.setup {
|
||||||
|
languages = {
|
||||||
|
vue = '<!-- %s -->',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
local M = {
|
local M = {
|
||||||
'nvim-treesitter/nvim-treesitter-context',
|
'nvim-treesitter/nvim-treesitter-context',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
},
|
||||||
opts = {},
|
opts = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,7 @@ local M = {
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
build = ':TSUpdate', -- parsers must be kept up to date with the plugin
|
build = ':TSUpdate', -- parsers must be kept up to date with the plugin
|
||||||
lazy = false, -- enable highlighting instantly
|
lazy = false, -- enable highlighting instantly
|
||||||
opts = {
|
opts = {},
|
||||||
ensure_installed = {
|
|
||||||
'bash'
|
|
||||||
},
|
|
||||||
sync_install = true,
|
|
||||||
auto_install = true,
|
|
||||||
highlight = { enable = true },
|
|
||||||
indent = { enable = true },
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue