" ------------- " ### LOOKS ### " ------------- set title "set titlestring=Vim set iconstring=Vim set listchars=tab:<·>,eol:¬,space:·,nbsp:⎵ syntax on set nowrap "do not wrap lines not fitting the screen set sidescroll=1 "do not jump half a screens whenever manuvering a line not fitting the screen set display=uhex "display hex chats as <[hex]> instead of ^C and ~C set laststatus=2 "display status bar set ruler "set statusline+=%l,%c%V%=%P set visualbell "flash instead of beeping; im not sure whether thats great or annoying "autocmd InsertEnter * silent !echo -ne "\e[1 q" "autocmd InsertLeave * silent !echo -ne "\e[0 q" let &t_VS = "\e[0 q" let &t_SI = "\e[1 q" let &t_EI = "\e[0 q" set showmatch "highlight pair of paranthesies set hlsearch "highlight search set wildmenu "visual command auto complete se nostartofline "Do not jump to first char of line when scolling set colorcolumn=100 " pseudo margin at 80 colorscheme knight set signcolumn=no set shortmess-=S "show match count on search " -------------------- " ### EASSE_OF_USE ### " -------------------- set bs=2 set undodir=/home/anon/stow/.cache/ set undofile set directory=/home/anon/stow/.cache/ set backupdir=/home/anon/stow/.cache/ set autoindent set ignorecase "ignore case in searches set smartcase "override ignorecase when upper case letters are used in the search set wildignorecase "ignore case when auto completing file and directory names (does not to shells) set autoread "chech for external changes in the file set autochdir set confirm "when quiting an unsaved filed, do not fail, instead ask back whether the buffer shall be saved, not saved, or cancel the operation set mouse=a nnoremap set keywordprg=:call\ ContextualMan()\ \" " better 'K' help set suffixes+=.info,.aux,.log,.dvi,.bbl,.out,.o,.lo,.obj " ignore on completion set foldopen-=hor " do not unfold on horizontal movement " always respect # pragma region set foldmarker=#pragma\ region,#pragma\ endregion set foldmethod=marker " tabs/spaces set tabstop=4 set shiftwidth=4 set expandtab set softtabstop=4 " ----------------- " ### Functions ### " ----------------- function ContextualMan() let word = expand('') let cmd = ":silent !" if &filetype == "vim" :help word return endif if &filetype == "cpp" let cmd .= "man -s 3,2 " . word . "; [ $? == 16 ] && cppman " elseif &filetype == "python" let cmd .= "pydoc " else if &filetype == "bash" || &filetype == "sh" let cmd .= "man 1 " else let cmd .= "man 3 " endif endif let cmd .= word execute cmd redraw! endfunction function! Signcolumn_toggle() if &signcolumn == 'no' set signcolumn=yes elseif &signcolumn == 'yes' set signcolumn=no endif endfunction function! Drawit_toggle() if !exists("s:drawit_boolean") let s:drawit_boolean = 0 endif if s:drawit_boolean DIstop let s:drawit_boolean = 0 else DIstart let s:drawit_boolean = 1 endif endfunction function! Programming_mode_toggle() if !exists("s:programming_mode_boolean") let s:programming_mode_boolean = 0 endif if s:programming_mode_boolean let s:programming_mode_boolean = 0 AcpDisable else let s:programming_mode_boolean = 1 AcpEnable endif endfunction function! Spell_toggle() if !exists("s:spell_boolean") let s:spell_boolean = 0 endif if s:spell_boolean set nospell let s:spell_boolean = 0 else set spell spelllang=en_us let s:spell_boolean = 1 endif endfunction " -------------- " ### REMAPS ### " -------------- " Diff_mode: if &diff map :diffput map :diffget endif " Complete_on_tab: inoremap pumvisible() ? "" : "" inoremap pumvisible() ? "\u\" : "\u\" inoremap pumvisible() ? "\" : "" inoremap pumvisible() ? "\" : "" " Function_keys: " ### Visibility island " F1: toggle whitespace visibility map :set invlist " F2: toggle visible line numbers map :set nu! " F3: toggle sign column map :call Signcolumn_toggle() " F4: unhighligh highlighted text map :noh " ### Feature island " F5: Display Turbo Menu map :call quickui#menu#open() " F6: compile with bake map :!bake %:p " F7: " NOTHING YET " F8: toggle acp (auto suggest) plugin mode map :call Programming_mode_toggle() " ### Call once in a while island " F9: copy file contents to clipboard map miggVG"+y'izz " F10: noremap " F11: noremap " F12: reload file "map :e! noremap " Tagbar_plugin: nmap m :TagbarToggle "------------------ " ### VARIABLES ### "------------------ let g:hitags_events = ["BufWrite"] let g:sigs_events = ["BufWrite"] " ------------- " ### NETRW ### " ------------- let g:netrw_keepdir = 0 let g:netrw_banner = 0 "let g:netrw_browse_split = 2 let g:netrw_liststyle = 3 " --------------- " ### QUICKUI ### " --------------- call quickui#menu#install('&Edit', [ \ [ '&Drawit', ':call Drawit_toggle()'], \ [ '&Expandtab', ':set expandtab!'], \ [ '&Brace unf*', ':%s/\n\s*{/ {/g'], \ ]) call quickui#menu#install('&View', [ \ [ '&Spell', ':call Spell_toggle()'], \ [ '&Netrw', ':Lex'], \ [ '&Diff', ':diffthis'], \ ]) call quickui#menu#install('&Modify', [ \ [ '&Remove trailing', ':%s/\s\+$//g'], \ [ '&Retab', ':retab!'], \ ]) call quickui#menu#install('&Development', [ \ [ '&Ascii Escape', ':ShowEscapeDictionary'], \ [ '&Make special', ':ShowMakeDictionary'], \ [ '&Symbol map', ':TagbarToggle', 'm'], \ ]) " ------------ " ### TMUX ### " ------------ function! Fname() if expand("%:t") != "" return expand("%:t") else return "vim" endif endfunction if exists('$TMUX') autocmd BufEnter * call system('tmux rename-window ' . Fname()) autocmd VimLeave * call system('sh -c "sleep 1 && tmux setw automatic-rename" & disown') autocmd BufEnter * let &titlestring = expand("%:t") "set title " already called endif "---###NOTES###--- "https://vimawesome.com/plugin/syntastic#introduction "" Souce VimScript9 settings "source ~/.vimrc9 set formatoptions-=cro " TEMP: highlight DiffChange ctermbg=3 " AI notes: " vl " :new " :windo diffthis