├── LICENSE └── init.vim /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Beka Modebadze 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /init.vim: -------------------------------------------------------------------------------- 1 | set nocompatible " disable compatibility to old-time vi 2 | set mouse=v " middle-click paste with 3 | set hlsearch " highlight search 4 | set incsearch " incremental search 5 | set tabstop=4 " number of columns occupied by a tab 6 | set softtabstop=4 " see multiple spaces as tabstops so does the right thing 7 | set expandtab " converts tabs to white space 8 | set shiftwidth=4 " width for autoindents 9 | set autoindent " indent a new line the same amount as the line just typed 10 | set number " add line numbers 11 | set wildmode=longest,list " get bash-like tab completions 12 | set cc=80 " set an 80 column border for good coding style 13 | filetype plugin indent on " allow auto-indenting depending on file type 14 | syntax on " syntax highlighting 15 | set mouse=a " enable mouse click 16 | set clipboard=unnamedplus " using system clipboard 17 | filetype plugin on 18 | set cursorline " highlight current cursorline 19 | set signcolumn=yes " 20 | set showmatch " show the matching brackets 21 | set ttyfast " Speed up scrolling in Vim 22 | set spell " enable spell check may need to download language package 23 | 24 | set completeopt=menuone,noinsert,noselect 25 | 26 | augroup numbertobble 27 | autocmd! BufEnter,FocusGained,InsertLeave * set relativenumber 28 | autocmd! BufLeave,FocusLost,InsertEnter * set norelativenumber 29 | augroup END 30 | 31 | set noswapfile " disable creating swap file 32 | set backupdir=~/.cache/vim " Directory to store backup files. 33 | let g:NERDTreeWinPos = "right" 34 | 35 | autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif 36 | 37 | call plug#begin('~/.vim/plugged') 38 | Plug 'morhetz/gruvbox' 39 | Plug 'dracula/vim' 40 | Plug 'ryanoasis/vim-devicons' 41 | Plug 'SirVer/ultisnips' 42 | Plug 'honza/vim-snippets' 43 | Plug 'scrooloose/nerdtree' 44 | Plug 'preservim/nerdcommenter' 45 | Plug 'mhinz/vim-startify' 46 | Plug 'dense-analysis/ale' 47 | Plug 'neovim/nvim-lspconfig' 48 | Plug 'sheerun/vim-polyglot' 49 | Plug 'jiangmiao/auto-pairs' 50 | Plug 'neomake/neomake' 51 | Plug 'kshenoy/vim-signature' 52 | 53 | " Rust stuff 54 | Plug 'simrat39/rust-tools.nvim' 55 | Plug 'rust-lang/rust.vim' 56 | Plug 'simrat39/rust-tools.nvim' 57 | Plug 'ycm-core/YouCompleteMe' 58 | Plug 'cespare/vim-toml' 59 | 60 | Plug 'hrsh7th/cmp-path' 61 | Plug 'hrsh7th/cmp-buffer' 62 | Plug 'hrsh7th/cmp-nvim-lsp' 63 | Plug 'hrsh7th/cmp-vsnip' 64 | Plug 'hrsh7th/nvim-cmp' 65 | 66 | " C++ 67 | Plug 'deoplete-plugins/deoplete-clang' 68 | 69 | " install cool looking bar 70 | Plug 'vim-airline/vim-airline' 71 | Plug 'vim-airline/vim-airline-themes' 72 | Plug 'tpope/vim-fugitive' 73 | 74 | " Optional dependencies 75 | Plug 'nvim-lua/popup.nvim' 76 | Plug 'nvim-lua/plenary.nvim' 77 | Plug 'nvim-telescope/telescope.nvim' 78 | 79 | " Python stuff 80 | Plug 'zchee/deoplete-jedi' 81 | 82 | " Debugging (needs plenary from above as well) 83 | Plug 'mfussenegger/nvim-dap' 84 | " Plug 'neoclide/coc.nvim', {'branch': 'release'} 85 | call plug#end() 86 | 87 | " YCM 88 | let g:ycm_extra_conf_globlist = ['~/.vim/plugged/YouCompleteMe/third_party/ycmd/*','!~/*'] 89 | let g:ycm_global_ycm_extra_conf = '~/.vim/plugged/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py' 90 | let g:ycm_clangd_args = ['-std=c++20'] 91 | 92 | " YouCompleteMe and UltiSnips compatibility. 93 | let g:ycm_use_ultisnips_completer = 1 94 | let g:ycm_key_list_select_completion = ['', ''] 95 | let g:ycm_key_list_previous_completion = ['', ''] 96 | let g:SuperTabDefaultCompletionType = '' 97 | " Rust config 98 | " As-you-type autocomplete 99 | set completeopt=menu,menuone,preview,noselect,noinsert 100 | let g:ale_completion_enabled = 1 101 | let g:ale_sign_error = '👹' 102 | let g:ale_sign_warning = '☢️' 103 | let g:ale_fixers = { 'rust': ['rustfmt', 'trim_whitespace', 'remove_trailing_lines'] } 104 | " let g:ale_sign_warning = 105 | let g:ycm_clangd_binary_path = "/usr/bin/clang" 106 | let g:ycm_seed_identifiers_with_syntax = 1 107 | set completeopt=menu 108 | 109 | " open the go-to function in split, not another buffer 110 | let g:jedi#use_splits_not_buffers = "right" 111 | let g:LanguageClient_serverCommands = { 112 | \ 'rust': ['rust-analyzer'], 113 | \ } 114 | 115 | " Configure LSP through rust-tools.nvim plugin. 116 | " rust-tools will configure and enable certain LSP features for us. 117 | " See https://github.com/simrat39/rust-tools.nvim#configuration 118 | lua <qf (lcn-code-action) 156 | 157 | " Setup Completion 158 | " YCM KEYBINDINGS 159 | function! YcmStuff() 160 | nnoremap ;; :YcmCompleter GoToDefinition 161 | nnoremap :YcmRestartServer 162 | nnoremap :YcmCompleter FixIt 163 | nnoremap K :YcmCompleter GetDoc 164 | nnoremap '' :YcmCompleter GetType 165 | nnoremap :YcmForceCompileAndDiagnostics 166 | endfunction 167 | 168 | function! Rusty() 169 | nnoremap :terminal cargo run 170 | nnoremap :terminal cargo test 171 | nnoremap :terminal cargo test -- --show-output 172 | inoremap :terminal cargo run 173 | endfunction 174 | 175 | augroup rust 176 | autocmd! 177 | autocmd FileType rust call Rusty() 178 | autocmd FileType rust call YcmStuff() 179 | augroup end 180 | 181 | 182 | " Set exit from terminal mode to Esc 183 | :tnoremap 184 | 185 | 186 | " Expand snippets from UltiSnips with tab 187 | let g:UltiSnipsExpandTrigger="" 188 | let g:UltiSnipsJumpForwardTrigger="" 189 | let g:UltiSnipsJumpBackwardTrigger="" 190 | let g:UltiSnipsSnippetDirectories = ['UltiSnips'] 191 | 192 | " Python Code Checker with pylint 193 | let g:neomake_python_enable_makers = ['pylint'] 194 | call neomake#configure#automake('nrwi', 500) 195 | 196 | " Set airline theme 197 | let g:airline_theme='tomorrow' 198 | let g:airline#extensions#branch#enabled = 1 199 | let g:airline#extensions#hunks#enabled=0 200 | 201 | " Note: You must define the dictionary first before setting values. 202 | " Also, it's a good idea to check whether it exists as to avoid 203 | " accidentally overwriting its contents. 204 | 205 | if !exists('g:airline_symbols') 206 | let g:airline_symbols = {} 207 | endif 208 | 209 | " powerline symbols 210 | let g:airline_left_sep = '' 211 | let g:airline_left_alt_sep = '' 212 | let g:airline_right_sep = '' 213 | let g:airline_right_alt_sep = '' 214 | let g:airline_symbols.branch = '' 215 | let g:airline_symbols.readonly = '' 216 | let g:airline_symbols.linenr = '☰' 217 | let g:airline_symbols.maxlinenr = '' 218 | let g:airline_symbols.dirty='⚡' 219 | 220 | " If you only see boxes here it may be because your system doesn't have 221 | " the correct fonts. Try it in vim first and if that fails see the help 222 | " pages for vim-airline :help airline-troubleshooting 223 | 224 | set termguicolors 225 | colorscheme gruvbox 226 | --------------------------------------------------------------------------------