vim.cmd('source ~/.vim/vimrc') vim.o.termguicolors = true vim.o.exrc = true vim.o.shadafile = (os.getenv("XDG_CACHE_HOME") or os.getenv("HOME") .. "/.cache" ) .. "/vim.shada" -- vimscript: get(environ(), "XDG_CACHE_HOME", "~/.cache")."/vim.shada" require'man' require'colorizer'.setup() -- language servers: -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md -- C/C++ | clang require'lspconfig'.clangd.setup{} -- lua require'lspconfig'.sumneko_lua.setup{ settings = { Lua = { diagnostics = { globals = { 'vim' } } } } } -- bash | bash-language-server require'lspconfig'.bashls.setup{} -- ccs | vscode-css-languageserver require'lspconfig'.cssls.setup{} -- rust | rust-analyzer require'lspconfig'.rust_analyzer.setup{} -- javascript | eslint require'lspconfig'.eslint.setup{} -- javascript | typescript-language-server require'lspconfig'.tsserver.setup{} -- vimscript | vim-language-server require'lspconfig'.vimls.setup{} require'lspconfig'.html.setup{} require'lspconfig'.jsonls.setup{} require'lspconfig'.pylsp.setup{ settings = { pylsp = { plugins = { pycodestyle = { ignore = {'W391'}, maxLineLength = 100 } } } } } require'cmp_nvim_lsp'.setup{} require'cmp'.setup { sources = { { name = 'nvim_lsp' } } } -- -- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers.. local capabilities = require('cmp_nvim_lsp').default_capabilities() -- -- -- The following example advertise capabilities to `clangd`. require'lspconfig'.clangd.setup { capabilities = capabilities, } -- Set up nvim-cmp. local cmp = require'cmp' cmp.setup({ snippet = { -- REQUIRED - you must specify a snippet engine expand = function(args) vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. -- require('snippy').expand_snippet(args.body) -- For `snippy` users. -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. end, }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), -- [''] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. [""] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true, }), [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'vsnip' }, -- For vsnip users. -- { name = 'luasnip' }, -- For luasnip users. -- { name = 'ultisnips' }, -- For ultisnips users. -- { name = 'snippy' }, -- For snippy users. }, { { name = 'buffer' }, }) }) -- Set configuration for specific filetype. cmp.setup.filetype('gitcommit', { sources = cmp.config.sources({ { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. }, { { name = 'buffer' }, }) }) -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline({ '/', '?' }, { mapping = cmp.mapping.preset.cmdline(), sources = { { name = 'buffer' } } }) -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline(':', { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = 'path' } }, { { name = 'cmdline' } }) }) -- -- Set up lspconfig. -- local capabilities = require('cmp_nvim_lsp').default_capabilities() -- -- Replace with each lsp server you've enabled. -- -- require('lspconfig')[''].setup { -- -- } -- -- -- C/C++ | clang -- require'lspconfig'.clangd.setup{capabilities = capabilities} -- -- -- bash | bash-language-server -- require'lspconfig'.bashls.setup{capabilities = capabilities} -- -- -- ccs | vscode-css-languageserver -- require'lspconfig'.cssls.setup{capabilities = capabilities} -- -- -- rust | rust-analyzer -- require'lspconfig'.rust_analyzer.setup{capabilities = capabilities} -- -- -- javascript | eslint -- require'lspconfig'.eslint.setup{capabilities = capabilities} -- -- -- javascript | typescript-language-server -- require'lspconfig'.tsserver.setup{capabilities = capabilities} -- -- -- vimscript | vim-language-server -- require'lspconfig'.vimls.setup{capabilities = capabilities} -- -- require'lspconfig'.html.setup{capabilities = capabilities} -- -- require'lspconfig'.jsonls.setup{capabilities = capabilities} -- require'nvim-treesitter.configs'.setup { -- A list of parser names, or "all" ensure_installed = { "c", "bash", "javascript" }, -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false, -- Automatically install missing parsers when entering buffer -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally auto_install = true, -- List of parsers to ignore installing (for "all") ignore_install = { "javascript" }, ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! highlight = { -- `false` will disable the whole extension enable = true, -- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- Using this option may slow down your editor, and you may see some duplicate highlights. -- Instead of true it can also be a list of languages additional_vim_regex_highlighting = false, }, }