nim
This commit is contained in:
parent
648602c92e
commit
fb5a44b5f0
2 changed files with 113 additions and 13 deletions
|
|
@ -18,20 +18,14 @@
|
|||
extraConfig = builtins.readFile ./config.vim;
|
||||
|
||||
plugins = with pkgs.vimPlugins;
|
||||
[
|
||||
cmp-nvim-lsp
|
||||
cmp-buffer
|
||||
cmp-emoji
|
||||
cmp-path
|
||||
cmp-cmdline
|
||||
cmp-nvim-ultisnips
|
||||
nvim-cmp
|
||||
|
||||
{
|
||||
plugin = nvim-lspconfig;
|
||||
type = "lua";
|
||||
config = builtins.readFile ./lsp.lua;
|
||||
}
|
||||
[
|
||||
cmp-buffer
|
||||
cmp-cmdline
|
||||
cmp-emoji
|
||||
cmp-nvim-lsp
|
||||
cmp-nvim-ultisnips
|
||||
cmp-path
|
||||
|
||||
{
|
||||
plugin = fzf-vim;
|
||||
|
|
@ -71,10 +65,34 @@
|
|||
nnoremap ]of :Limelight!<return>
|
||||
'';
|
||||
}
|
||||
|
||||
nabla-nvim
|
||||
neogit
|
||||
|
||||
{
|
||||
plugin = nvim-cmp;
|
||||
type = "lua";
|
||||
config = builtins.readFile ./nvim-cmp.lua;
|
||||
}
|
||||
|
||||
{
|
||||
plugin = nvim-colorizer-lua;
|
||||
config = "lua require 'colorizer'.setup()";
|
||||
}
|
||||
|
||||
{
|
||||
plugin = nvim-lspconfig;
|
||||
type = "lua";
|
||||
config = ''
|
||||
vim.lsp.enable('astro')
|
||||
vim.lsp.enable('marksman')
|
||||
vim.lsp.enable('nil_ls')
|
||||
vim.lsp.enable('r_language_server')
|
||||
vim.lsp.enable('texlab')
|
||||
vim.lsp.enable('ts_ls')
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
plugin = papercolor-theme;
|
||||
config = ''
|
||||
|
|
@ -82,7 +100,9 @@
|
|||
colorscheme PaperColor
|
||||
'';
|
||||
}
|
||||
|
||||
typescript-vim
|
||||
|
||||
{
|
||||
plugin = ultisnips;
|
||||
type = "lua";
|
||||
|
|
@ -90,14 +110,18 @@
|
|||
vim.api.nvim_set_keymap('n', '<leader>se', ':UltiSnipsEdit!<return>', { noremap = true, silent = true })
|
||||
'';
|
||||
}
|
||||
|
||||
vifm-vim
|
||||
|
||||
{
|
||||
plugin = vim-astro;
|
||||
config = ''
|
||||
let g:astro_typescript = 'enable'
|
||||
'';
|
||||
}
|
||||
|
||||
vim-commentary
|
||||
|
||||
{
|
||||
plugin = vim-easy-align;
|
||||
config = ''
|
||||
|
|
@ -105,9 +129,11 @@
|
|||
nmap ga <Plug>(EasyAlign)
|
||||
'';
|
||||
}
|
||||
|
||||
vim-fish
|
||||
vim-nix
|
||||
vim-repeat
|
||||
|
||||
{
|
||||
plugin = vim-slime;
|
||||
config = ''
|
||||
|
|
@ -121,10 +147,12 @@
|
|||
nnoremap s: :SlimeSend1
|
||||
'';
|
||||
}
|
||||
|
||||
vim-snippets
|
||||
vim-speeddating
|
||||
vim-surround
|
||||
vim-unimpaired
|
||||
vimwiki
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
|||
72
home/nvim/nvim-cmp.lua
Normal file
72
home/nvim/nvim-cmp.lua
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
local cmp = require'cmp'
|
||||
|
||||
cmp.setup({
|
||||
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
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({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<Tab>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'cmp_pandoc' },
|
||||
{ name = 'emoji' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'path' },
|
||||
{ name = 'ultisnips' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
-- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below
|
||||
-- Set configuration for specific filetype.
|
||||
--[[ cmp.setup.filetype('gitcommit', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'git' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
require("cmp_git").setup() ]]--
|
||||
|
||||
-- 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' }
|
||||
}),
|
||||
matching = { disallow_symbol_nonprefix_matching = false }
|
||||
})
|
||||
|
||||
-- Set up lspconfig.
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
|
||||
vim.lsp.config('<YOUR_LSP_SERVER>', {
|
||||
capabilities = capabilities
|
||||
})
|
||||
vim.lsp.enable('<YOUR_LSP_SERVER>')
|
||||
Loading…
Add table
Add a link
Reference in a new issue