diff --git a/users/tsv/home.nix b/users/tsv/home.nix index 08e1041..97e403a 100644 --- a/users/tsv/home.nix +++ b/users/tsv/home.nix @@ -74,22 +74,27 @@ programs.neovim = { enable = true; plugins = with pkgs.vimPlugins; [ - telescope-nvim - gruvbox-nvim - nvim-treesitter.withAllGrammars - nvim-web-devicons - nvim-tree-lua - vim-fugitive - git-messenger-vim - nvim-lspconfig - nvim-cmp - cmp-treesitter - cmp-path cmp-nvim-lsp - cmp-buffer - hologram-nvim + cmp-path + cmp-treesitter + cmp-vsnip + friendly-snippets # Collection of predefined snippets + fugitive-gitlab-vim + git-messenger-vim + gruvbox-nvim + hologram-nvim # For images inside kitty + nvim-cmp nvim-dap nvim-dap-ui + nvim-lspconfig + nvim-treesitter.withAllGrammars + nvim-tree-lua + nvim-web-devicons + telescope-nvim + vim-fugitive + vim-rhubarb # GitHub support for fugitive + vim-vsnip + vim-vsnip-integ vimwiki ]; }; diff --git a/users/tsv/nvim/init.lua b/users/tsv/nvim/init.lua index 1cf864f..3e39894 100644 --- a/users/tsv/nvim/init.lua +++ b/users/tsv/nvim/init.lua @@ -17,6 +17,9 @@ require("gruvbox").setup({ }) vim.cmd([[colorscheme gruvbox]]) +-- Git +vim.g.fugitive_gitlab_domains = {'https://git.foxsoft.co.uk'} + -- Strip trailing spaces vim.api.nvim_create_autocmd({"BufWritePre"}, { pattern = { "*" }, @@ -42,11 +45,32 @@ require'nvim-treesitter.configs'.setup { } -- Completion and LSP -require'cmp'.setup { - sources = { - { name = 'nvim_lsp' } - } +local cmp = require'cmp' +cmp.setup { + snippet = { + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) + 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 = true }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'vsnip' }, + { name = 'path' }, + { name = 'treesitter' }, + }) } +local capabilities = require('cmp_nvim_lsp').default_capabilities() require'lspconfig'.solargraph.setup {} -- Vimwiki