Browse Source

nvim config additions

Hans Martin 2 years ago
parent
commit
6606f8d260
1 changed files with 60 additions and 6 deletions
  1. 60 6
      .config/nvim/init.vim

+ 60 - 6
.config/nvim/init.vim

@@ -23,21 +23,33 @@
 call plug#begin('~/.vim/plugged')
     Plug 'itchyny/lightline.vim'                            " simple, goodlooking statusline
     Plug 'junegunn/fzf.vim'                                 " fuzzy finder for files/buffers ..
-    Plug 'ervandew/supertab'                                " tabcompletion
+    "Plug 'ervandew/supertab'                                " tabcompletion
     Plug 'junegunn/goyo.vim'                                " Goyo, distraction free writing for LaTeX
     Plug 'HansMartin/inline-python'                         " Inline Python exec.
-    Plug 'airblade/vim-rooter'                              " root-directory finder
     Plug 'dylanaraps/wal.vim'                               " Set coloscheme from pywal
     Plug 'rust-lang/rust.vim'                               " For Rust
     Plug 'preservim/nerdtree'                               " Not sure if needed
     Plug 'tpope/vim-fugitive'                               " Git for Vim
+    Plug 'zah/nim.vim'                                      " Nim Plugin
+    Plug 'neovim/nvim-lspconfig'                            " Official Language Server Protocol
+    Plug 'nvim-lua/completion-nvim'
+    Plug 'nvim-lua/plenary.nvim'
+    Plug 'nvim-telescope/telescope.nvim'
+    Plug 'catppuccin/nvim', {'as': 'catppuccin', 'branch':'main'}
+    Plug 'neoclide/coc.nvim', {'branch': 'release'}          " Testing
+    Plug 'chriskempson/base16-vim'
+
 call plug#end()
 
+" Loads lua config from lua/init.lua
+lua require('init')
+
 
 " -----[ BASICS ]----- "
 
 " Color Settings
 colorscheme wal             " using the wal colorscheme
+"colorscheme catppuccin      " using the wal colorscheme
 set mouse=a                 " for moving splits with the mouse
 
 " Encoding
@@ -113,7 +125,9 @@ autocmd VimResized * wincmd =
 
 " use Ctr+C for Copy Pasterino into sys. clipboard
 vnoremap <C-c> "*y :let @+=@*<CR>
-nnoremap <leader>c "+yy
+nnoremap <C-S-V> "+p
+inoremap <C-S-V> <c-r>+
+cnoremap <C-S-V> <c-r>+
 
 
 " Bind Goyo to shortcut
@@ -138,8 +152,8 @@ let g:lightline = {
 
 " FZF - Best Tool ever
 nnoremap <C-t> :Tags<CR>
-nnoremap <C-b> :Buffers<CR>
-nnoremap <C-n> :Files<CR>
+nnoremap <C-b> :Telescope buffers<CR>
+nnoremap <C-n> :Telescope find_files<CR>
 
 " Nerdtree (tmp replacement with Vifm
 nnoremap <C-t> :NERDTreeToggle<CR>
@@ -250,5 +264,45 @@ if exists("b:current_syntax")
 endif
 
 " Conceal
-hi Conceal guibg=NONE
+"hi Conceal guibg=NONE
 setlocal cole=1
+
+
+if exists("g:neovide")
+    colorscheme catppuccin
+    let g:neovide_cursor_animation_length=0.15
+    let g:neovide_cursor_trail_length=0.3
+endif
+
+" -----[ Completion ]----- "
+
+" Use <Tab> and <S-Tab> to navigate through popup menu
+"inoremap <expr> <Tab>   pumvisible() ? "\<C-n>" : "\<Tab>"
+"inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
+" imap <silent> <c-space> :<Plug>(completion_trigger)
+
+" Set completeopt to have a better completion experience
+set completeopt=menuone,noinsert,noselect
+
+" Avoid showing message extra message when using completion
+set shortmess+=c
+let g:completion_trigger_character = ['.', '::']
+
+
+
+" -----[ COC ]----- "
+set signcolumn=number
+
+" use <tab> for trigger completion and navigate to the next complete item
+function! CheckBackspace() abort
+  let col = col('.') - 1
+  return !col || getline('.')[col - 1]  =~# '\s'
+endfunction
+
+inoremap <silent><expr> <Tab>
+      \ coc#pum#visible() ? coc#pum#next(1) :
+      \ CheckBackspace() ? "\<Tab>" :
+      \ coc#refresh()
+
+inoremap <expr> <Tab> coc#pum#visible() ? coc#pum#next(1) : "\<Tab>"
+inoremap <expr> <S-Tab> coc#pum#visible() ? coc#pum#prev(1) : "\<S-Tab>"