diff --git a/nvim/coc-settings.json b/nvim/coc-settings.json index 4d1fd44..624d742 100644 --- a/nvim/coc-settings.json +++ b/nvim/coc-settings.json @@ -1,11 +1,11 @@ { + "eslint.enable": true, "eslint.autoFixOnSave": true, - "eslint.filetypes": ["javascript", "javascriptreact", "typescript", "typescriptreact", "html"], + "eslint.filetypes": ["javascript", "javascriptreact", "typescript", "typescriptreact"], "coc.preferences.formatOnSaveFiletypes": [ "javascript", "javascriptreact", "typescript", - "html", "typescriptreact" ], "tsserver.formatOnType": true, diff --git a/nvim/init.vim b/nvim/init.vim index 4938e05..2bab164 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -4,11 +4,16 @@ set number " Enable numbers set encoding=UTF-8 set cursorline set clipboard=unnamed +set list +set lcs+=space:· + " Plugin manager call plug#begin('~/.vim/plugged') + Plug 'kdheepak/lazygit.nvim' Plug 'preservim/nerdtree' + Plug 'Xuyuanp/nerdtree-git-plugin' Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'vim-airline/vim-airline' Plug 'ryanoasis/vim-devicons' @@ -27,9 +32,22 @@ call plug#begin('~/.vim/plugged') Plug 'vim-airline/vim-airline-themes' Plug 'nvim-tree/nvim-web-devicons' Plug 'romgrk/barbar.nvim' + Plug 'neovim/nvim-lspconfig' + Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + " Plug 'hrsh7th/cmp-nvim-lsp' + " Plug 'hrsh7th/cmp-buffer' + " Plug 'hrsh7th/cmp-path' + " Plug 'hrsh7th/cmp-cmdline' + " Plug 'hrsh7th/nvim-cmp' + Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } + Plug 'junegunn/fzf.vim' call plug#end() +" AutoComplete +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\" : "\" + " Indents settings set tabstop=2 set shiftwidth=2 @@ -44,6 +62,7 @@ let g:NERDTreeDirArrowExpandable = '▸' let g:NERDTreeDirArrowCollapsible = '▾' " Keybinds +nmap :LazyGit nnoremap :NERDTreeToggle nmap gd (coc-definition) nmap gy (coc-type-definition) @@ -64,15 +83,14 @@ vnoremap s lua require('spectre').open_visual() nnoremap sp viw:lua require('spectre').open_file_search() " run command :Spectre -" COC completion settings let g:coc_global_extensions = [ - \ 'coc-json', - \ 'coc-css', - \ 'coc-prettier', - \ 'coc-eslint', - \ 'coc-highlight' - \ 'coc-tsserver' - \ ] +\ 'coc-json', +\ 'coc-css', +\ 'coc-prettier', +\ 'coc-eslint', +\ 'coc-highlight', +\ 'coc-tsserver' +\ ] " Airline settings let g:airline#extensions#tabline#enabled = 1 @@ -86,6 +104,20 @@ colorscheme github_dark " autocmds autocmd CursorHold * silent call CocActionAsync('highlight') +nnoremap K :call CocAction('doHover') +function! ShowDocIfNoDiagnostic(timer_id) + if (coc#float#has_float() == 0 && CocHasProvider('hover') == 1) + silent call CocActionAsync('doHover') + endif +endfunction + +function! s:show_hover_doc() + call timer_start(500, 'ShowDocIfNoDiagnostic') +endfunction + +autocmd CursorHoldI * :call show_hover_doc() +autocmd CursorHold * :call show_hover_doc() + " autopairs config au FileType html let b:AutoPairs = AutoPairsDefine({''}, ['{']) au FileType xml let b:AutoPairs = AutoPairsDefine({''}, ['{']) @@ -133,3 +165,28 @@ let g:closetag_shortcut = '>' " let g:closetag_close_shortcut = '>' +" LazyGIt config +let g:lazygit_floating_window_winblend = 0 " transparency of floating window +let g:lazygit_floating_window_scaling_factor = 0.9 " scaling factor for floating window +let g:lazygit_floating_window_border_chars = ['╭','─', '╮', '│', '╯','─', '╰', '│'] " customize lazygit popup window border characters +let g:lazygit_floating_window_use_plenary = 0 " use plenary.nvim to manage floating window if available +let g:lazygit_use_neovim_remote = 1 " fallback to 0 if neovim-remote is not installed + +let g:lazygit_use_custom_config_file_path = 0 " config file path is evaluated if this value is 1 +let g:lazygit_config_file_path = '' " custom config file path +" OR +let g:lazygit_config_file_path = [] " list of custom config file paths + +lua <