summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nvim.init.vim.experimental52
1 files changed, 50 insertions, 2 deletions
diff --git a/nvim.init.vim.experimental b/nvim.init.vim.experimental
index 2a7d81d..6872a22 100644
--- a/nvim.init.vim.experimental
+++ b/nvim.init.vim.experimental
@@ -8,8 +8,16 @@ let mapleader=" "
" -----------------
call plug#begin('~/.nvim/plugged')
- Plug 'gruvbox-community/gruvbox'
+ " Colors.
+ Plug 'chriskempson/base16-vim'
+
+ " LSP & Completion.
Plug 'neovim/nvim-lspconfig'
+ Plug 'hrsh7th/nvim-compe'
+
+ " FZF.
+ Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
+ Plug 'junegunn/fzf.vim'
call plug#end()
" -----------------
@@ -18,7 +26,7 @@ call plug#end()
set termguicolors
set background=dark
-colorscheme gruvbox
+colorscheme base16-default-dark
set relativenumber
set number
@@ -43,6 +51,8 @@ set noswapfile
set hlsearch
set incsearch
+set nowrap
+
if executable('rg')
set grepprg=rg\ --vimgrep
endif
@@ -64,6 +74,7 @@ local on_attach = function(_client, bufnr)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<C-]>", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>r", "<Cmd>lua vim.lsp.buf.references()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>i", "<Cmd>lua vim.lsp.buf.implementation()<CR>", opts)
+ vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>f", "<Cmd>lua vim.lsp.buf.formatting()<CR>", opts)
end
-- Setup rust-analyzer.
@@ -76,6 +87,43 @@ require'lspconfig'.clangd.setup {
cmd = { "clangd", "--background-index", "--completion-style=detailed" },
on_attach = on_attach,
}
+
+-- Setup pyright.
+require'lspconfig'.pyright.setup {
+ on_attach = on_attach,
+}
+
+-- Setup nvim-compe.
+require'compe'.setup {
+ enabled = true;
+ autocomplete = true;
+ debug = false;
+ min_length = 1;
+ preselect = 'enable';
+ throttle_time = 80;
+ source_timeout = 200;
+ incomplete_delay = 400;
+ max_abbr_width = 100;
+ max_kind_width = 100;
+ max_menu_width = 100;
+ documentation = true;
+
+ source = {
+ path = true;
+ buffer = false;
+ calc = false;
+ nvim_lsp = true;
+ nvim_lua = false;
+ vsnip = false;
+ ultisnips = false;
+ };
+}
+
+vim.o.completeopt = "menuone,noselect"
+
+vim.api.nvim_set_keymap("i", "<C-Space>", "compe#complete()", {expr = true})
+vim.api.nvim_set_keymap("i", "<CR>", "compe#confirm('<CR>')", {expr = true})
+vim.api.nvim_set_keymap("i", "<C-e>", "compe#close('<C-e>')", {expr = true})
EOF
" -----------------