-rw-r--r-- start/self/plugin/settings.vim
1 set nocompatible " be iMproved, required 2 filetype plugin indent on " required 3 set autoread " update when file is modified outside of vim 4 set autowrite " update file when changing buffers, opening new files, etc 5 au BufLeave * :silent! update " save automatically when leaving buffer 6 set lazyredraw " dont update screen during macros/scripts 7 set hlsearch " Highlight all search results - toggled by <Leader>h 8 set smartcase " searches ignore case only if all lower case 9 set incsearch " Searches for strings while typing search term 10 set gdefault " use global by default for substitutions 11 12 set shiftwidth=4 " Default number of auto-indent spaces 13 set autoindent " Auto-indent new lines 14 set smartindent " Enable smart-indent 15 set smarttab " shiftwidth tab at start of line, otherwise softtabstop width tab 16 set softtabstop=4 " Number of spaces per tab 17 set linebreak " Allow backspacing over indention, line breaks and insertion start 18 set backspace=indent,eol,start " Backspace behaviour 19 set formatoptions+=j " Delete comment characters when joining lines. 20 "autocmd FileType * setlocal formatoptions-=cro " disable autocommenting 21 set matchtime=2 22 set conceallevel=0 " disable all concealing 23 set nojoinspaces " don't put 2 spaces after periods when joining lines 24 25 set undolevels=200 " Number of undo levels 26 set undodir=~/.vim/undo// " undo files 27 set backupdir=~/.vim/backups// " backups 28 set directory=~/.vim/swap// " swap files 29 set noswapfile 30 31 set splitbelow " default new sp window goes below 32 set splitright " default new vsp window goes right 33 set scrolloff=4 " keep x lines at top and bottom visible when scrollingkeep x lines at top and bottom visible when scrolling 34 autocmd VimResized * wincmd = " keep splits equal size when resizing window 35 36 syntax on " enable syntax highlighting 37 set mouse=a " enable mouse 38 set t_Co=16 " use the 16 terminal colours 39 40 set sessionoptions=buffers,folds,tabpages 41 set viewoptions=folds,cursor 42 43 set wildmenu " enable wildmenu for tab completion of commands 44 set wildignorecase " disable wildmenu case sensitivity 45 set wildmode=full:list " format wildmenu to expand and scroll with tab 46 47 set autochdir " cwd to current file 48 set updatetime=500 " update time for swap files (unused) and e.g. ALE hover 49 50 let g:netrw_liststyle=0 " Set netrw style to thin listing 51 let g:netrw_sort_sequence='[\/]$' 52 53 " restore last line in opened file 54 au BufReadPost * 55 \ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit' 56 \ | exe "normal! g`\"" 57 \ | endif 58 59 " Intelligently navigate tmux panes and Vim splits using the same keys. 60 " See https://sunaku.github.io/tmux-select-pane.html for documentation. 61 let progname = substitute($VIM, '.*[/\\]', '', '') 62 if empty(v:servername) 63 set title titlestring=%{progname}\ [%n]\ %F 64 else 65 set title titlestring=%{progname}\ [%{v:servername}]\ [%n]\ %F 66 endif 67 if &term =~ '^screen' && !has('nvim') | exe "set t_ts=\e]2; t_fs=\7" | endif 68 69 70 " if exists("$WAYLAND_DISPLAY") 71 " set ttym=sgr 72 " endif 73 74 runtime macros/emoji-ab.vim 75 76 " Only linters listed explicitly will be run. 77 let g:ale_linters_explicit = 1 78 let g:ale_linters = { 79 \ 'haskell': ['hlint'], 80 \ 'python': ['flake8', 'pyright', 'ruff'], 81 "\ 'rust': ['analyzer'], 82 \ 'terraform': ['tflint', 'terraform_ls'], 83 \} 84 "\ 'typescriptreact': ['tsserver', 'eslint'], 85 "\ 'typescript': ['tsserver', 'eslint'], 86 " Don't show errors in virtual text or signs column; rely on echoed message instead 87 let g:ale_virtualtext_cursor = 0 88 let g:ale_set_signs = 0 89 "let g:ale_command_wrapper = 'nice -n5' 90 let g:ale_fixers = { 91 \ 'haskell': ['ormolu'], 92 \ 'python': ['black', 'ruff'], 93 \ 'typescriptreact': ['eslint'], 94 \ 'typescript': ['eslint'], 95 \ 'rust': ['rustfmt'], 96 \} 97 "\ 'markdown': ['prettier'], 98 let g:ale_echo_cursor = 1 99 100 let g:vim_markdown_conceal = 0 101 let g:vim_markdown_conceal_code_blocks = 0 102 let g:vim_json_conceal=0 103 let g:markdown_syntax_conceal=0 104 105 " used by Ctrl-P, likely among other things 106 set wildignore+=*/tmp/*,*.so,*.swp,*.zip,node_modules,target,.mypy_cache 107 108 "" For some reason i need this for typescriptreact files to be configured 109 "augroup run_ftplugin_typescriptreact 110 " autocmd! 111 " autocmd FileType typescriptreact source ~/.vim/pack/vim-misc/start/self/ftplugin/typescriptreact.vim 112 " autocmd FileType typescript source ~/.vim/pack/vim-misc/start/self/ftplugin/typescript.vim 113 " autocmd FileType javascript source ~/.vim/pack/vim-misc/start/self/ftplugin/javascript.vim 114 "augroup END 115