" base settings set nocompatible let mapleader="," " plugin manager and plugin list filetype off set rtp+=$XDG_CONFIG_HOME/vim/plugins/Vundle.vim call vundle#begin('$XDG_CONFIG_HOME/vim/plugins') Plugin 'VundleVim/Vundle.vim' " language-specific Plugin 'leafgarland/typescript-vim' " themes Plugin 'rose-pine/vim' Plugin 'ghifarit53/tokyonight-vim' call vundle#end() filetype plugin on " or plugin indent on ? " plugin config let g:netrw_banner=0 " hide banner let g:netrw_browse_split=0 " opens in same window let g:netrw_liststyle=3 " listing style: tree let g:netrw_list_hide= '.*\.swp$' " let g:netrw_list_hide.=netrw_gitignore#Hide() " TODO add toggle to exaand/collapse whole tree let g:typescript_indent_disable = 1 " functions func! ToggleTabMode() set expandtab! if &expandtab echo "using space characters in place of tabs" else echo "using tab characters" endif endfunc " TODO add function (or something) similar to gf, but clear the buffer in " which it is run (idea is to use this with results of grep in blank pane) " copy & paste: registers, clipboard set clipboard+=unnamed " TODO or maybe unamedplus? " colors, themes, appearance "set background=light let g:tokyonight_style = 'night' " available: night, storm colorscheme tokyonight " colorscheme rosepine_moon " measurements, numbers, visual/audible cues set cursorline set colorcolumn=89,90 set noerrorbells novisualbell set hlsearch set laststatus=2 set number relativenumber set ruler set showcmd set noshowmode set title " syntax highlighting syntax enable " TODO 'enable' or 'on'? " settings for buffers set hidden " settings for panes/splits, tabs set splitright splitbelow map h map j map k map l " finding and opening files set wildmenu set path+=** " text input and editing set tabstop=4 set expandtab autocmd BufEnter * set formatoptions-=ro " TODO get recursion working for the tags command below command! MakeTags !ctags -f tags -R . " shortcuts or aliases " shortcuts for find in pane/tab nnoremap f. :find* nmap fr :vnewf. nmap fb :newf. nmap ft :tabnewf. " shortcuts for grep in pane/tab nnoremap g, :r!grep--exclude-dir=node_modules-rIi. nmap g. :enewg, nmap gr :vnewg, nmap gb :newg, nmap gt :tabnewg, " shortcuts for tree (netrw) in pane/tab nnoremap t. :edit. nnoremap tr :vsplit. nnoremap tb :split. nnoremap tt :tabnew. " toggle tab/space mode nnoremap tab :call ToggleTabMode() " toggles related to line numbers and cursor nnoremap nu :set number! nnoremap rnu :set relativenumber! nnoremap cc :set cuc! " searching: replace-all in file nnoremap ra :%s//g " TODO maybe add global (working dir, recursive) replace-all feature? " format file content nnoremap fmtjson :%!jq.- " automatic actions autocmd BufWritePre * %s/\s\+$//e " delete trailing whitespace " autocmd BufWritePre * %s/\n\+\%$//e " delete end-of-file newlines