From 6fcc0d6729672745939a19306fd89fdc50750a0c Mon Sep 17 00:00:00 2001 From: Anas Elgarhy Date: Thu, 10 Mar 2022 20:09:54 +0200 Subject: [PATCH] Add neovim configs --- .config/nvim/coc-settings.json | 28 +++++++++++++++++++++ .config/nvim/init.vim | 45 ++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .config/nvim/coc-settings.json create mode 100644 .config/nvim/init.vim diff --git a/.config/nvim/coc-settings.json b/.config/nvim/coc-settings.json new file mode 100644 index 0000000..536f165 --- /dev/null +++ b/.config/nvim/coc-settings.json @@ -0,0 +1,28 @@ +"languageserver": { + "ccls": { + "command": "ccls", + "filetypes": ["c", "cc", "cpp", "c++", "objc", "objcpp"], + "rootPatterns": [".ccls", "compile_commands.json", ".git/", ".hg/"], + "initializationOptions": { + "cache": { + "directory": "/tmp/ccls" + } + } + }, + "bash": { + "command": "bash-language-server", + "args": ["start"], + "filetypes": ["sh"] + }, + "arduino":{ + "command":"/path/to/arduino-language-server", + "rootPatterns":["*.ino"], + "filetypes":["arduino"], + "args":["-cli", "/path/to/arduino-cli", "-clangd", "/path/to/clangd", "-cli-config", "/path/to/arduino-cli.yaml"] + }, + "golang": { + "command": "gopls", + "rootPatterns": ["go.mod"], + "filetypes": ["go"] + } +} diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 0000000..0365112 --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,45 @@ +:set number +:set relativenumber +:set autoindent +:set tabstop=4 +:set shiftwidth=4 +:set smarttab +:set softtabstop=4 +:set encoding=UTF-8 + +" Plugins +call plug#begin() +Plug 'https://github.com/wakatime/vim-wakatime' " wakatime plugin +Plug 'https://github.com/github/copilot.vim' " Copilot +Plug 'https://github.com/vim-scripts/Gist.vim' " Gits plugin +Plug 'https://github.com/folke/todo-comments.nvim' " Highlight todo comments +Plug 'https://github.com/tpope/vim-surround' " Surround +Plug 'https://github.com/tpope/vim-commentary' " Commenting gcc &gc +Plug 'https://github.com/preservim/nerdtree' " File tree +Plug 'https://github.com/preservim/tagbar' " Tagbar +Plug 'https://github.com/terryma/vim-multiple-cursors' " Multiple cursors +Plug 'https://github.com/vim-airline/vim-airline' " Status bar theme +call plug#end() + +" NERDTree keybindings +nnoremap :NERDTreeFocus +nnoremap :NERDTree +nnoremap :NERDTreeToggle +nnoremap :call CocActionAsync('jumpDefinition') + +" air-line +let g:airline_powerline_fonts = 1 + +if !exists('g:airline_symbols') + let g:airline_symbols = {} +endif + +" airline symbols +let g:airline_left_sep = '' +let g:airline_left_alt_sep = '' +let g:airline_right_sep = '' +let g:airline_right_alt_sep = '' +let g:airline_symbols.branch = '' +let g:airline_symbols.readonly = '' +let g:airline_symbols.linenr = ' LN ' +let g:airline_symbols.colnr = ' CN '