set nocompatible " disable compatibility to old-time vi set showmatch " show matching set ignorecase " case insensitive set hlsearch " highlight search set incsearch " incremental search set tabstop=4 " number of columns occupied by a tab set softtabstop=4 " see multiple spaces as tabstops so does the right thing set expandtab " converts tabs to white space set shiftwidth=4 " width for autoindents set autoindent " indent a new line the same amount as the line just typed set number " add line numbers set relativenumber " turn relative line numbers on set rnu set laststatus=2 set wildmode=longest,list " get bash-like tab completions set cc=80 " set an 80 column border for good coding style syntax on " syntax highlighting set mouse=a " enable mouse click set clipboard=unnamedplus " using system clipboard filetype plugin on set cursorline " highlight current cursorline set ttyfast " Speed up scrolling in Vim set spell " enable spell check (may need to download language package) set spelllang=en,ru set spellsuggest=best,9 " regenerate spell dicts on startup for d in glob('~/.vim/spell/*.add', 1, 1) if filereadable(d) && (!filereadable(d . '.spl') || getftime(d) > getftime(d . '.spl')) exec 'mkspell! ' . fnameescape(d) endif endfor nnoremap :set spell! inoremap :set spell! set noswapfile " disable creating swap file set backupdir=~/.cache/vim " Directory to store backup files. filetype plugin indent on "allow auto-indenting depending on file type nnoremap :bnext nnoremap :bprev let g:python3_host_prog = '/usr/bin/python3.10' " let g:python3_host_prog = '/home/apr/work/tchk/venv/bin/python3.10' " let g:python3_host_prog = '/home/apr/.virtualenvs/pyg/bin/python3' " netrw magic " enable mouse usage. makes it easier to browse multiple tabs set mouse=a " hide netrw top message let g:netrw_banner=0 " tree listing by default let g:netrw_liststyle=3 " hide vim swap files let g:netrw_list_hide='.*\.swp$' " open files in left window by default let g:netrw_chgwin=1 " remap alt-enter to fire up the sidebar nnoremap :rightbelow 20vs:e . " " the same remap as above - may be necessary in some distros " nnoremap :rightbelow 20vs:e . " remap control-enter to open files in new tab nmap t :rightbelow 20vs:e .:wincmd h " the same remap as above - may be necessary in some distros nmap t :rightbelow 20vs:e .:wincmd h call plug#begin("~/.vim/plugged") " Plugin Section " light theme Plug 'sonph/onehalf', { 'rtp': 'vim' } " autoquotes Plug 'jiangmiao/auto-pairs' " to show separate buffers as tabs Plug 'ap/vim-buftabline' " have no idea Plug 'tpope/vim-vinegar' " some icons Plug 'ryanoasis/vim-devicons' Plug 'SirVer/ultisnips' Plug 'honza/vim-snippets' Plug 'mhinz/vim-startify' " Plug 'NLKNguyen/papercolor-theme' Plug 'habamax/vim-asciidoctor' " markdown shit Plug 'godlygeek/tabular' Plug 'plasticboy/vim-markdown' " deoplete for whatever it is needed Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'zchee/deoplete-jedi' Plug 'roxma/nvim-yarp' Plug 'roxma/vim-hug-neovim-rpc' " Plugin for renaming python and not only Plug 'davidhalter/jedi-vim' Plug 'neomake/neomake' " tree sitter at least for better highlighting " as recommended updating the parsers on update Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " bindings for shellcheck Plug 'itspriddle/vim-shellcheck' " Fuzzy finder Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " vim-plug Plug 'LnL7/vim-nix' " Collection of common configurations for the Nvim LSP client Plug 'neovim/nvim-lspconfig' " Completion framework " Plug 'hrsh7th/nvim-cmp' " LSP completion source for nvim-cmp " Plug 'hrsh7th/cmp-nvim-lsp' " Snippet completion source for nvim-cmp " Plug 'hrsh7th/cmp-vsnip' " Other usefull completion sources " Plug 'hrsh7th/cmp-path' " Plug 'hrsh7th/cmp-buffer' " See hrsh7th's other plugins for more completion sources! " To enable more of the features of rust-analyzer, such as inlay hints and more! Plug 'simrat39/rust-tools.nvim' " gitblame Plug 'f-person/git-blame.nvim' call plug#end() set t_Co=256 set cursorline set termguicolors colorscheme summerfruit256 let g:airline_theme='onehalfdark' " lightline " let g:lightline = { 'colorscheme': 'onehalfdark' } " vim-markdown disable folding let g:vim_markdown_folding_disabled=1 let g:deoplete#enable_at_startup = 1 " disable autocompletion, because we use deoplete for completion let g:jedi#completions_enabled = 0 " open the go-to function in split, not another buffer let g:jedi#use_splits_not_buffers = "right" " when to wtivate neomake call neomake#configure#automake('nrwi', 50) " enable linter let g:neomake_python_enabled_makers = ['pylint'] " Set ultisnips triggers let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" " buftabline configuration let g:buftabline_numbers=1 let g:buftabline_indicators=1 let &fillchars ..= ',eob: ' " nnoremap :set spell! nnoremap :FZF " Rust setup " Set completeopt to have a better completion experience " :help completeopt " menuone: popup even when there's only one match " noinsert: Do not insert text until a selection is made " noselect: Do not select, force user to select one from the menu " set completeopt=menuone,noinsert,noselect " " " Avoid showing extra messages when using completion " set shortmess+=c " " " Configure LSP through rust-tools.nvim plugin. " " rust-tools will configure and enable certain LSP features for us. " " See https://github.com/simrat39/rust-tools.nvim#configuration " lua <'] = cmp.mapping.select_prev_item(), " -- [''] = cmp.mapping.select_next_item(), " -- Add tab support " -- [''] = cmp.mapping.select_prev_item(), " -- [''] = cmp.mapping.select_next_item(), " [''] = cmp.mapping.scroll_docs(-4), " [''] = cmp.mapping.scroll_docs(4), " [''] = cmp.mapping.complete(), " [''] = cmp.mapping.close(), " [''] = cmp.mapping.confirm({ " behavior = cmp.ConfirmBehavior.Insert, " select = true, " }) " }, " " -- Installed sources " sources = { " { name = 'nvim_lsp' }, " { name = 'vsnip' }, " { name = 'path' }, " { name = 'buffer' }, " }, " }) " EOF " " " Set updatetime for CursorHold " " 300ms of no cursor movement to trigger CursorHold " set updatetime=300 " " Show diagnostic popup on cursor hold " autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false }) " " " Goto previous/next diagnostic warning/error " nnoremap g[ lua vim.diagnostic.goto_prev() " nnoremap g] lua vim.diagnostic.goto_next() " " " have a fixed column for the diagnostics to appear in " " this removes the jitter when warnings/errors flow in " set signcolumn=yes