diff options
Diffstat (limited to 'nvim/plugins.vim')
| -rw-r--r-- | nvim/plugins.vim | 174 |
1 files changed, 19 insertions, 155 deletions
diff --git a/nvim/plugins.vim b/nvim/plugins.vim index 572eeb5..fe7b8f6 100644 --- a/nvim/plugins.vim +++ b/nvim/plugins.vim | |||
| @@ -6,31 +6,21 @@ endif | |||
| 6 | 6 | ||
| 7 | " vim-plug | 7 | " vim-plug |
| 8 | call plug#begin() | 8 | call plug#begin() |
| 9 | Plug 'mattn/emmet-vim' | 9 | Plug 'neovim/nvim-lspconfig' |
| 10 | 10 | ||
| 11 | Plug 'nvim-tree/nvim-web-devicons' | 11 | Plug 'nvim-tree/nvim-web-devicons' |
| 12 | Plug 'nvim-tree/nvim-tree.lua' | 12 | Plug 'nvim-tree/nvim-tree.lua' |
| 13 | 13 | ||
| 14 | Plug 'preservim/tagbar' | ||
| 15 | Plug 'romainl/vim-cool' | 14 | Plug 'romainl/vim-cool' |
| 16 | Plug 'simnalamburt/vim-mundo' | 15 | |
| 17 | Plug 'tpope/vim-repeat' | 16 | Plug 'tpope/vim-repeat' |
| 18 | Plug 'tpope/vim-surround' | 17 | Plug 'tpope/vim-surround' |
| 18 | |||
| 19 | Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} | 19 | Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} |
| 20 | Plug 'neovim/nvim-lspconfig' | 20 | |
| 21 | Plug 'windwp/nvim-autopairs' | 21 | Plug 'windwp/nvim-autopairs' |
| 22 | Plug 'windwp/nvim-ts-autotag' | 22 | Plug 'windwp/nvim-ts-autotag' |
| 23 | 23 | ||
| 24 | Plug 'hrsh7th/nvim-cmp' | ||
| 25 | Plug 'L3MON4D3/LuaSnip' | ||
| 26 | Plug 'saadparwaiz1/cmp_luasnip' | ||
| 27 | Plug 'rafamadriz/friendly-snippets' | ||
| 28 | |||
| 29 | Plug 'hrsh7th/cmp-nvim-lsp' | ||
| 30 | Plug 'hrsh7th/cmp-buffer' | ||
| 31 | " Plug 'hrsh7th/cmp-path' | ||
| 32 | " Plug 'hrsh7th/cmp-cmdline' | ||
| 33 | |||
| 34 | Plug 'lewis6991/gitsigns.nvim' | 24 | Plug 'lewis6991/gitsigns.nvim' |
| 35 | 25 | ||
| 36 | Plug 'RRethy/vim-illuminate' | 26 | Plug 'RRethy/vim-illuminate' |
| @@ -39,23 +29,12 @@ call plug#begin() | |||
| 39 | Plug 'nvim-lua/plenary.nvim' | 29 | Plug 'nvim-lua/plenary.nvim' |
| 40 | Plug 'nvim-telescope/telescope.nvim' | 30 | Plug 'nvim-telescope/telescope.nvim' |
| 41 | 31 | ||
| 42 | "Plug 'cocopon/iceberg.vim' | 32 | " Colorscheme |
| 43 | Plug 'tomasiser/vim-code-dark' | 33 | Plug 'tomasiser/vim-code-dark' |
| 44 | call plug#end() | 34 | call plug#end() |
| 45 | 35 | ||
| 46 | " EMMET | ||
| 47 | let g:user_emmet_install_global=0 | ||
| 48 | let g:user_emmet_leader_key='<C-y>' | ||
| 49 | |||
| 50 | " Tagbar | ||
| 51 | let g:tagbar_ctags_bin='/usr/local/bin/uctags' | ||
| 52 | |||
| 53 | " Vimundo | ||
| 54 | let g:mundo_right=1 | ||
| 55 | let g:mundo_width=40 | ||
| 56 | let g:mundo_preview_height=30 | ||
| 57 | |||
| 58 | lua << EOF | 36 | lua << EOF |
| 37 | |||
| 59 | -- nvim-tree | 38 | -- nvim-tree |
| 60 | vim.g.loaded_netrw = 1 | 39 | vim.g.loaded_netrw = 1 |
| 61 | vim.g.loaded_netrwPlugin = 1 | 40 | vim.g.loaded_netrwPlugin = 1 |
| @@ -69,6 +48,9 @@ require("nvim-tree").setup({ | |||
| 69 | }, | 48 | }, |
| 70 | renderer = { | 49 | renderer = { |
| 71 | group_empty = true, | 50 | group_empty = true, |
| 51 | indent_markers = { | ||
| 52 | enable = true, | ||
| 53 | }, | ||
| 72 | }, | 54 | }, |
| 73 | filters = { | 55 | filters = { |
| 74 | dotfiles = true, | 56 | dotfiles = true, |
| @@ -89,131 +71,11 @@ require('nvim-treesitter.configs').setup { | |||
| 89 | } | 71 | } |
| 90 | 72 | ||
| 91 | require('nvim-autopairs').setup() | 73 | require('nvim-autopairs').setup() |
| 92 | require('nvim-ts-autotag').setup() | ||
| 93 | |||
| 94 | local capabilities = require('cmp_nvim_lsp').default_capabilities() | ||
| 95 | capabilities.textDocument.completion.completionItem.snippetSupport = true | ||
| 96 | |||
| 97 | local lspconfig = require('lspconfig') | ||
| 98 | |||
| 99 | lspconfig.clangd.setup{ | ||
| 100 | cmd = { 'clangd15' }, | ||
| 101 | capabilities = capabilities | ||
| 102 | } | ||
| 103 | |||
| 104 | lspconfig.lua_ls.setup{ | ||
| 105 | settings = { | ||
| 106 | Lua = { | ||
| 107 | runtime = { | ||
| 108 | version = 'LuaJIT', | ||
| 109 | }, | ||
| 110 | diagnostics = { | ||
| 111 | globals = {'vim'}, | ||
| 112 | }, | ||
| 113 | workspace = { | ||
| 114 | library = vim.api.nvim_get_runtime_file("", true), | ||
| 115 | }, | ||
| 116 | telemetry = { | ||
| 117 | enable = false, | ||
| 118 | }, | ||
| 119 | }, | ||
| 120 | }, | ||
| 121 | capabilities = capabilities | ||
| 122 | } | ||
| 123 | |||
| 124 | lspconfig.cssls.setup{ | ||
| 125 | capabilities = capabilities | ||
| 126 | } | ||
| 127 | |||
| 128 | lspconfig.html.setup{ | ||
| 129 | capabilities = capabilities | ||
| 130 | } | ||
| 131 | |||
| 132 | lspconfig.ts_ls.setup{ | ||
| 133 | capabilities = capabilities | ||
| 134 | } | ||
| 135 | 74 | ||
| 136 | lspconfig.vimls.setup{ | 75 | require('nvim-ts-autotag').setup() |
| 137 | capabilities = capabilities | ||
| 138 | } | ||
| 139 | |||
| 140 | lspconfig.jsonls.setup{ | ||
| 141 | capabilities = capabilities | ||
| 142 | } | ||
| 143 | |||
| 144 | lspconfig.gopls.setup{ | ||
| 145 | capabilities = capabilities | ||
| 146 | } | ||
| 147 | |||
| 148 | local project_library_path = "/home/t/.local/lib/node_modules" | ||
| 149 | local ng_cmd = {"ngserver", "--stdio", "--tsProbeLocations", project_library_path , "--ngProbeLocations", project_library_path} | ||
| 150 | |||
| 151 | lspconfig.angularls.setup{ | ||
| 152 | capabilities = capabilities, | ||
| 153 | cmd = ng_cmd, | ||
| 154 | on_new_config = function(new_config,new_root_dir) | ||
| 155 | new_config.cmd = ng_cmd | ||
| 156 | end, | ||
| 157 | } | ||
| 158 | |||
| 159 | lspconfig.markdown_oxide.setup{ | ||
| 160 | capabilities = capabilities, | ||
| 161 | on_attach = on_attach, | ||
| 162 | cmd = { | ||
| 163 | 'markdown-oxide' | ||
| 164 | } | ||
| 165 | } | ||
| 166 | 76 | ||
| 167 | require('gitsigns').setup() | 77 | require('gitsigns').setup() |
| 168 | 78 | ||
| 169 | require("luasnip.loaders.from_vscode").lazy_load() | ||
| 170 | |||
| 171 | local cmp = require('cmp') | ||
| 172 | |||
| 173 | cmp.setup{ | ||
| 174 | snippet = { | ||
| 175 | expand = function(args) | ||
| 176 | require('luasnip').lsp_expand(args.body) | ||
| 177 | end, | ||
| 178 | }, | ||
| 179 | window = { | ||
| 180 | completion = cmp.config.window.bordered(), | ||
| 181 | documentation = cmp.config.window.bordered(), | ||
| 182 | }, | ||
| 183 | mapping = cmp.mapping.preset.insert{ | ||
| 184 | ['<C-b>'] = cmp.mapping.scroll_docs(-4), | ||
| 185 | ['<C-f>'] = cmp.mapping.scroll_docs(4), | ||
| 186 | ['<C-Space>'] = cmp.mapping.complete(), | ||
| 187 | ['<C-e>'] = cmp.mapping.abort(), | ||
| 188 | ['<CR>'] = cmp.mapping.confirm({ select = true }), | ||
| 189 | }, | ||
| 190 | sources = cmp.config.sources{ | ||
| 191 | { | ||
| 192 | name = 'nvim_lsp', | ||
| 193 | option = { | ||
| 194 | markdown_oxide = { | ||
| 195 | keyword_pattern = [[\(\k\| \|\/\|#\)\+]] | ||
| 196 | } | ||
| 197 | } | ||
| 198 | }, | ||
| 199 | { | ||
| 200 | name = 'luasnip' | ||
| 201 | }, | ||
| 202 | }, | ||
| 203 | { | ||
| 204 | { | ||
| 205 | name = 'buffer' | ||
| 206 | }, | ||
| 207 | } | ||
| 208 | } | ||
| 209 | |||
| 210 | local cmp_autopairs = require('nvim-autopairs.completion.cmp') | ||
| 211 | cmp.event:on( | ||
| 212 | 'confirm_done', | ||
| 213 | cmp_autopairs.on_confirm_done() | ||
| 214 | ) | ||
| 215 | |||
| 216 | -- default configuration | ||
| 217 | require('illuminate').configure({ | 79 | require('illuminate').configure({ |
| 218 | -- providers: provider used to get references in the buffer, ordered by priority | 80 | -- providers: provider used to get references in the buffer, ordered by priority |
| 219 | providers = { | 81 | providers = { |
| @@ -260,7 +122,7 @@ require('illuminate').configure({ | |||
| 260 | -- If nil, vim-illuminate will be disabled for large files. | 122 | -- If nil, vim-illuminate will be disabled for large files. |
| 261 | large_file_overrides = nil, | 123 | large_file_overrides = nil, |
| 262 | -- min_count_to_highlight: minimum number of matches required to perform highlighting | 124 | -- min_count_to_highlight: minimum number of matches required to perform highlighting |
| 263 | min_count_to_highlight = 1, | 125 | min_count_to_highlight = 2, |
| 264 | -- should_enable: a callback that overrides all other settings to | 126 | -- should_enable: a callback that overrides all other settings to |
| 265 | -- enable/disable illumination. This will be called a lot so don't do | 127 | -- enable/disable illumination. This will be called a lot so don't do |
| 266 | -- anything expensive in it. | 128 | -- anything expensive in it. |
| @@ -270,18 +132,20 @@ require('illuminate').configure({ | |||
| 270 | }) | 132 | }) |
| 271 | 133 | ||
| 272 | -- change the highlight style | 134 | -- change the highlight style |
| 273 | vim.api.nvim_set_hl(0, "IlluminatedWordText", { link = "CursorLine" }) | 135 | |
| 274 | vim.api.nvim_set_hl(0, "IlluminatedWordRead", { link = "CursorLine" }) | 136 | vim.api.nvim_set_hl(0, "IlluminatedWordText", { link = "MatchParen" }) |
| 275 | vim.api.nvim_set_hl(0, "IlluminatedWordWrite", { link = "CursorLine" }) | 137 | vim.api.nvim_set_hl(0, "IlluminatedWordRead", { link = "MatchParen" }) |
| 138 | vim.api.nvim_set_hl(0, "IlluminatedWordWrite", { link = "MatchParen" }) | ||
| 276 | 139 | ||
| 277 | --- auto update the highlight style on colorscheme change | 140 | --- auto update the highlight style on colorscheme change |
| 278 | vim.api.nvim_create_autocmd({ "ColorScheme" }, { | 141 | vim.api.nvim_create_autocmd({ "ColorScheme" }, { |
| 279 | pattern = { "*" }, | 142 | pattern = { "*" }, |
| 280 | callback = function(ev) | 143 | callback = function(ev) |
| 281 | vim.api.nvim_set_hl(0, "IlluminatedWordText", { link = "CursorLine" }) | 144 | vim.api.nvim_set_hl(0, "IlluminatedWordText", { link = "MatchParen" }) |
| 282 | vim.api.nvim_set_hl(0, "IlluminatedWordRead", { link = "CursorLine" }) | 145 | vim.api.nvim_set_hl(0, "IlluminatedWordRead", { link = "MatchParen" }) |
| 283 | vim.api.nvim_set_hl(0, "IlluminatedWordWrite", { link = "CursorLine" }) | 146 | vim.api.nvim_set_hl(0, "IlluminatedWordWrite", { link = "MatchParen" }) |
| 284 | end | 147 | end |
| 285 | }) | 148 | }) |
| 149 | |||
| 286 | EOF | 150 | EOF |
| 287 | 151 | ||
