───────┬──────────────────────────────────────────────────────────────────────── │ File: /home/mitch/.vimrc ───────┼──────────────────────────────────────────────────────────────────────── 1 │ " Title......: .vimrc 2 │ " Description: My setting file for vim 3 │ " Author.....: Mitchell Johnston 4 │ " Updated....: Fri 21 Feb 2025 05:53:49 AM CST 5 │ " 6 │ " Reference 7 │ " ========= 8 │ " 9 │ " Macros 10 │ " j gj Allows scroll down in sentence by line 11 │ " k gk Allows scroll up in sentence by line 12 │ " \b Markdown __bold__ word 13 │ " \i Markdown _italic_ word 14 │ " \e Open tab with emoji 15 │ " \l Run dictionary lookup script (default to lookup word under cursor) 16 │ " \N Toggle line numbers 17 │ " \n Scratch Pad 18 │ " \s Search KJV 19 │ " \S Toggle spell check 20 │ " \t Term in split window 21 │ " \T Term in a Tab 22 │ " \v Open .vimrc in new tab, sources when saved 23 │ " \pb Paragraph style=blue 24 │ " \py Paragraph style=yellow 25 │ " \pr Paragraph style=red 26 │ " \pg Paragraph style=green 27 │ " \wa Bash Cookbook 28 │ " \wb Bash Quick ref 29 │ 30 │ " Control and Alt Key mappings 31 │ " A-g Mark class=green 32 │ " A-r Mark class=red 33 │ " C-b Mark class=blue 34 │ " C-t Toggle Terminal 35 │ " C-y Mark class=yellow 36 │ 37 │ " F-Keys 38 │ " F2 New tab Netrw 39 │ " F3 Get URLS in current buffer (uses youtube-dl) 40 │ " F4 - autocomplete, backward Insert mode 41 │ " F5 - autocomplete, forward Insert mode 42 │ " F6 Replace current line with kjv output 43 │ " F7 Replace current line with formated output for file under /var/www (mp4 or 44 │ " picture) 45 │ " F8 Replace current line with link to file unde /var/www 46 │ " F9 Run ./compiler in current directory 47 │ " F12 Open file current buffer 48 │ " S-F12 Open file new tab 49 │ 50 │ " :Commands 51 │ 52 │ " :Plug{tab} Plugin manager 53 │ " :term Open a split window term 54 │ " :TableModeToggle VIM Table Mode toggle 55 │ 56 │ 57 │ " Typing savers 58 │ " ============== 59 │ 60 │ " bash 61 │ ab _var # Variables<CR>---------<CR><ESC>0D 62 │ ab _func # Functions<CR>---------<CR><ESC>0D 63 │ ab _main # Main<CR>----<CR><ESC>0D 64 │ 65 │ " urls 66 │ ab _crn http://crn.hopto.org/ 67 │ ab _email mitch@crn.hopto.org 68 │ ab _gop gopher://crn.hopto.org 69 │ ab _Jesus [Jesus](/Jesus) 70 │ ab _kjv [KJV](/#kjv) 71 │ ab _KJV [KJV](/#kjv) 72 │ ab _Bible [Bible](/bible) 73 │ ab _bible [Bible](/bible) 74 │ 75 │ " dates 76 │ ab _date <C-R>=strftime("%a %b %d %Y")<CR> 77 │ ab _time <C-R>=strftime("%T")<CR> 78 │ ab _u Updated: <C-R>=strftime('%A %m/%d/%y')<CR> 79 │ 80 │ " admonitions 81 │ ab _? :question: 82 │ ab _! :exclamation: __Important:__ 83 │ ab _ao 🎧 __Audio Only__ 84 │ ab _bl 🤬 __Warning bad language__ 85 │ ab _c :computer: __Code:__ 86 │ ab _ch :chart_with_upwards_trend: _Chart Of The Day:_ 87 │ ab _hc :sparkling_heart: __Health Clip__ 88 │ ab _d 🥵 __Warning Disturbing__ 89 │ ab _fun :laughing: __Some humor to lighten the day:__ 90 │ ab _geek 🧠 __Geek Related:__ 91 │ ab _k :key: 92 │ ab _l 🔗 __Links:__ 93 │ ab _memo :memo: __Note:__ 94 │ ab _book 📖 __Worth Reading:__ 95 │ ab _mw 🤓 ___Must Watch___ 96 │ ab _rl :+1: __Rule of Thumb__ 97 │ ab _tip :bulb: __Tip:__ 98 │ ab _up 🔧 __Updates:__ 99 │ ab _warn :warning: __Warning:__ 100 │ ab _ar 🔗 _Off-site Artical_ 101 │ 102 │ " misc 103 │ ab --0 [🔝](#)<CR><HR><CR><ESC> 104 │ ab --1 <hr class="one"> 105 │ ab --2 <hr class="two"> 106 │ ab --3 <hr class="three"> 107 │ ab --p <hr class="packman"> 108 │ ab _A >🎧 Audio Included<CR> 109 │ ab _V >🎥 Video Included<CR> 110 │ ab _L ### [🔗 title](link){target="blank"} 111 │ ab _mj Mitchell Johnston - UID 0 112 │ ab _nl :newspaper: __News Links:__<CR> 113 │ ab _see - [👓 See more](link) 114 │ ab _sn - [📝 Show Notes](link){target="blank"} 115 │ ab _ts :mortar_board: [__Theological Seminary Of The Air__](/mp3/ruckman/theologic-seminary-of-the-air/)<CR> 116 │ ab _tb {target="blank"} 117 │ ab _div <div style="text-align: center;"> 118 │ ab _re <u>Related:</u> 119 │ ab _U </u> 120 │ ab _u <u><ESC>i 121 │ ab _vc <script src="https://av1611.com/verseclick/verseclick.js"></script> 122 │ ab _iframe <iframe src="link" scrolling="no" width="100%" height="400" style="border:1px solid black;"></iframe> 123 │ ab _Iframe <iframe src="link" scrolling="no" onload="resizeIframe(this) style="border:1px solid black;"></iframe> 124 │ 125 │ " Offsite 126 │ ab _axe - [🔗 Dr Axe](https://draxe.com/){target="blank"} 127 │ ab _da - [🔗 Dr. Ardis](https://thedrardisshow.com/){target="blank"} 128 │ ab _dlm - [🔗 Dr. Lee Merritt](https://drleemerritt.com/){target="blank"} 129 │ ab _dk - [🔗 The David Knight Show](http://www.thedavidknightshow.com/){target="blank"}<CR>- [🔗 David Knight Gold](https://davidknight.gold/){target="blank"} 130 │ ab _jl - [🔗 Jon Levi](https://jonlevichannel.com/){target="blank"} 131 │ ab _kb - [🔗 Dr. Ken Berry](https://www.drberry.com/){target="blank"} 132 │ ab _mia - [🔗 Man in America](https://rumble.com/c/ManInAmerica){target="blank"} 133 │ ab _mi - [🔗 Mises](https://mises.org/){target="blank"} 134 │ ab _mlb - [🔗 MYLUNCHBREAK](https://rumble.com/c/MYLUNCHBREAK){target="blank"} 135 │ ab _norm - [🔗 Norml](https://norml.org/){target="blank"} 136 │ ab _rc - [🔗 Rain Country](https://rumble.com/c/RainCountryHomestead){target="blank"} 137 │ ab _pft - [🔗 Press for Truth](https://pressfortruth.ca/){target="blank"} 138 │ ab _rg - [🔗 ReallyGraceful](https://rumble.com/user/reallygraceful){target="blank"}<CR>- [🔗 The Deep State Encyclopedia: Exposing the Cabal's Playbook](https://www.amazon.com/Deep-State-Encyclopedia-Exposing-Playbook/dp/B0BW2K4GRT/ref=sr_1_1?crid=L3E7PRK32XAF&dib=eyJ2IjoiMSJ9.abdCs2CjZJUaoZb39XP1UU8PqU7hXwaPfdKvrBkA9eCv7-LBc27eAel8xNDCA9zbfMUzTLgmqVOaHUFVH93Cd75NVYt7BO7hi5OldPhjRiz70HMSGAcxacy0gIN3us4p.OuuQzd1UMe1hFSXk6R4NUlJB66CS144pPKpvG3mP8MA&dib_tag=se&keywords=deep+state+encyclopedia+really+graceful&qid=1726739581&sprefix=really+gra%2Caps%2C158&sr=8-1){target="blank"} 139 │ ab _wf - [🔗 The Why Files](https://rumble.com/c/TheWhyFiles){target="blank"} 140 │ 141 │ " On-site 142 │ 143 │ ab _911 - [🎬 More on 911](/media/911/) 144 │ ab _addict - [🎬 More on Addiction](/media/health/addiction/) 145 │ ab _arc - [🎬 For more content check the archives](/media/) 146 │ ab _ba - [💻 Bible Analyzer](/media/bible-analyzer) 147 │ ab _berg - [🎬 More from Dr Berg](/media/health/dr-berg/) 148 │ ab _bio - [🎬 More Biography](/media/biography/) 149 │ ab _chicks - [🎬 More on Chickens](/media/prep/chickens-rabbits/) 150 │ ab _cooper - [🎬 More from Bill Cooper](/media/bill-cooper/) 151 │ ab _control - [🎬 More on Control](/media/control/) 152 │ ab _covid - [🎬 More on Covid](/media/health/covid/) 153 │ ab _cr - [🎬 More from James Corbett](/media/corbett/) 154 │ ab _cults - [🎬 More Cults](/media/cults/) 155 │ ab _dental - [🎬 More on Dental](/media/health/dental/) 156 │ ab _detox - [🎬 More on Detox](health/#detox) 157 │ ab _diet - [🎬 More on Diet](/media/health/diet/) 158 │ ab _dirt - [🎬 More on Diatomaceous Earth](/media/health/minerals/diatomaceous-earth/) 159 │ ab _env - [🎬 More Environment](/media/environment/) 160 │ ab _em - [🎬 More Eustace Mullins](/media/eustace-mullins/) 161 │ ab _flat - [🎬 More Flat Earth](/media/flat/) 162 │ ab _gatto - [🎬 More from John Talor Gatto](/media/john-t-gatto/) 163 │ ab _gear - [🎬 More Gear](/media/gear/) 164 │ ab _geg - [🎬 More from G.Edward Griffin](/media/g-edward-griffin/) 165 │ ab _gr - [🎬 More from Gail Riplinger](/media/riplinger/) 166 │ ab _garden - [🎬 More Gardening](/media/prep/garden/) 167 │ ab _hemp - [🎬 More from Hemp](/media/health/remedies/hemp/) 168 │ ab _herbs - [🎬 More from Herbs](/media/health/remedies/herbs/) 169 │ ab _history - [🎬 More history](/media/history/) 170 │ ab _jd - [🎬 More from Dr James Dinicolantonio](/media/health/dr-james-dinicolantonio/) 171 │ ab _law - [🎬 More Law](/media/law/) 172 │ ab _larkin - [🎬 More from Larkin Rose](/media/larkin/) 173 │ ab _levy - [🎬 More from Dr Thomas Levy](/media/health/dr-thomas-levy/) 174 │ ab _mica - [🎬 More from Mica Colston](/media/mica-colston/) 175 │ ab _min [🎬 More Minerals](/include/vids/health/minerals/) 176 │ ab _money - [🎬 More money](/media/money/) 177 │ ab _mp3 - [🎧 MP3 Files](/mp3) 178 │ ab _ortho - [🎬 More Orthomolecular Medicine](/include/vids/health/orthomolecular/) 179 │ ab _pets - [🎧 More Pets](/media/prep/pets/) 180 │ ab _pics - [🎨 More Pictures](/pics) 181 │ ab _radio - [🎬 More on Radio](/media/gear/radio/) 182 │ ab _rem - [🎬 More Remedies](/include/vids/health/remedies/) 183 │ ab _mms - [🎬 More MMS](/include/vids/health/remedies/mms) 184 │ ab _ruckman - [🎬 More from Peter Ruckman](/media/ruckman/) 185 │ ab _sam - [🎬 More from Dr Sam Bailey](/media/health/dr-sam-bailey/) 186 │ ab _sircus - [🎬 More from Dr Mark Sircus](/media/health/dr-mark-sircus/) 187 │ ab _save - [🔗 Salvation (forgiveness)](/salvation) 188 │ ab _selft - [🎬 More on Self Therapy](/media/health/self-therapy/) 189 │ ab _spy - [🎬 More Spying](/media/spying/) 190 │ ab _survive - [🎬 More on Survival](/media/survive/) 191 │ ab _tea - [🎬 More on Tea](/include/vids/health/remedies/tea/) 192 │ ab _turp - [🎬 More Turpentine](/include/vids/health/remedies/essential-oils/turpentine) 193 │ ab _vernon - [🎬 More from Dr Vernon Coleman](/media/health/vernon/) 194 │ 195 │ 196 │ " Create task, check off, uncheck (see my .bashrc functions 'today' & 'task') 197 │ ab ,c - [ ] 198 │ map ,C :s/\[ \]/\[✔\]<CR> " Completed 199 │ map ,X :s/\[❌\]/\[ \]<CR> " Unmark completed 200 │ map ,i :s/\[ \]/\[🔨\]<CR> " In progress 201 │ map ,I :s/\[🔨\]/\[ \]<CR> " Unmark In progress 202 │ map ,o :s/\[ \]/\[⭕\]<CR> " Outsourced 203 │ map ,O :s/\[⭕\]/\[ \]<CR> " Unmark Outsourced 204 │ 205 │ " Settings 206 │ " ======== 207 │ 208 │ set wildoptions=pum 209 │ set cryptmethod=blowfish " use blowfish encryption for encrytped files 210 │ set switchbuf=usetab " when switching buffers, include tabs 211 │ set splitright " create vertical splits to the right 212 │ set splitbelow " create horizontal splits below 213 │ set formatoptions=croq " c=autowrap comments, r=continue comment on <enter>, 214 │ " o=continue comment on o or O, q=allow format comment with gqgq 215 │ set backspace=2 " allow backspacing over everything in insert mode 216 │ set encoding=UTF-8 217 │ 218 │ 219 │ 220 │ " Folds 221 │ set foldenable " Enable folding 222 │ set foldmethod=indent " Folding based on markers 223 │ set foldlevelstart=10 " open most folds by default 224 │ set foldnestmax=10 " 10 nested fold max 225 │ 226 │ " Tabs 227 │ set hardtabs=4 " Tab setups 228 │ set tabstop=4 229 │ set shiftwidth=4 230 │ set expandtab " tab to spaces 231 │ set softtabstop=4 " number of spaces in tab when editing 232 │ set tabpagemax=15 " Max number of tabs displayed 233 │ set showtabline=2 " always display tab line 234 │ 235 │ " Completion 236 │ set dictionary+=~/etc/words-alpha.txt "Ctr-n, Ctr-p word complete 237 │ set complete+=k 238 │ set ignorecase " On searches 239 │ set infercase 240 │ set autoindent " Good for codding 241 │ set smartindent " Turn on file typed indenting 242 │ set shiftround " When shifting lines, round the indentation to the nearest multiple of “shiftwidth.” 243 │ set history=50 " keep 50 lines of command line history 244 │ set laststatus=2 " Make sure the status line is always displayed 245 │ set nocompatible " Better for Vim features 246 │ set shell=/bin/bash " Set default shell 247 │ set scrolloff=0 " Start scrolling when I'm 3 lines from top/bottom 248 │ set backspace=indent,eol,start "Allow backspacing over indention, line breaks and insertion start 249 │ set lbr! " wrap on words 250 │ set formatoptions+=j " Delete comment characters when joining lines. 251 │ set spell " Turn on spell check 252 │ set belloff=all 253 │ 254 │ " Display 255 │ "set nu " turn on line numbers 256 │ set ruler " Display ruler 257 │ set showcmd " Show commands 258 │ set showmatch " Show matching brackets 259 │ set showmode " Display what mode you are in 260 │ set cursorline " highlight current line 261 │ set wildmenu " visual autocomplete for command menu 262 │ "set list " show hidden characters 263 │ set listchars=eol:¬,tab:→→,trail:.,extends:>,precedes:< 264 │ set autoread 265 │ 266 │ " Search 267 │ set path+=** " :find {file} supports wilecard 268 │ set wildmenu " tab completetion 269 │ set hlsearch " Highlight search matches 270 │ set smartcase " Turn off ignorcase if caps is used 271 │ set incsearch " search as characters are entered 272 │ 273 │ " netrw setting 274 │ let g:netrw_liststyle = 3 275 │ let ghregex='\(^\|\s\s\)\zs\.\S\+' 276 │ let g:netrw_list_hide=ghregex 277 │ 278 │ " backup files 279 │ silent !mkdir ./.backup > /dev/null 2>&1 280 │ silent !mkdir ~/.vim/backup > /dev/null 2>&1 281 │ set viminfo='1000,f1,<500 " File information to Keep 282 │ set backup "Turn on backups 283 │ set backupdir=./.backup/,~/.vim/backup "The place to remove files after I make big errors 284 │ set backupskip=/tmp/*,~/.vim/backup/* 285 │ set writebackup "Make backup before overwriting the current buffer 286 │ set backupcopy=yes "Overwrite the original backup file 287 │ au BufWritePre * let &bex = '@' . strftime("%F.%H:%M") 288 │ 289 │ " Keep undo history across sessions by storing it in a file 290 │ if has('persistent_undo') 291 │ call system('mkdir ~/.vim/undo') 292 │ set undodir=~/.vim/undo/ 293 │ set undofile 294 │ set undolevels=1000 295 │ set undoreload=10000 296 │ endif 297 │ 298 │ " Vim-plug 299 │ if empty(glob('~/.vim/autoload/plug.vim')) 300 │ silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs 301 │ \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 302 │ autocmd VimEnter * PlugInstall --sync | source $MYVIMRC 303 │ endif 304 │ 305 │ " Plugins will be downloaded under the specified directory. 306 │ call plug#begin('~/.vim/plugged') 307 │ " Declare the list of plugins. 308 │ Plug 'ryanoasis/vim-devicons' 309 │ Plug 'marcopaganini/termschool-vim-theme' 310 │ Plug 'junegunn/fzf' 311 │ Plug 'junegunn/fzf.vim' 312 │ Plug 'katono/rogue.vim' 313 │ Plug 'dhruvasagar/vim-table-mode' 314 │ Plug 'hallison/vim-markdown' 315 │ Plug 'ap/vim-css-color' 316 │ 317 │ "Vim Rogue options 318 │ let g:rogue#name = 'Mitch' 319 │ let g:rogue#directory = '/home/mitch/etc' 320 │ let g:rogue#jump = '1' 321 │ let g:rogue#tombstone = '1' 322 │ let g:rogue#fruit = 'Grapes' 323 │ 324 │ " enable this plugin for filetypes, '*' for all files. 325 │ let g:apc_enable_ft = {'text':1, 'markdown':1, 'php':1} 326 │ 327 │ " List ends here. Plugins become visible to Vim after this call. 328 │ call plug#end() 329 │ 330 │ " File types 331 │ " ========== 332 │ augroup configgroup 333 │ autocmd! 334 │ autocmd BufNewFile,BufFilePre,BufRead *.md set filetype=markdown 335 │ autocmd BufNewFile,BufFilePre,BufRead *.txt set filetype=txt 336 │ autocmd FileType make setlocal noexpandtab 337 │ autocmd BufEnter Makefile setlocal noexpandtab 338 │ autocmd BufEnter *.sh setlocal tabstop=2 339 │ autocmd BufEnter *.sh setlocal shiftwidth=2 340 │ autocmd BufEnter *.sh setlocal softtabstop=2 341 │ au BufNewFile,BufRead *conkyrc* set filetype=conkyrc 342 │ autocmd bufwritepost .vimrc source $MYVIMRC 343 │ autocmd bufwritepost sp.md <ESC>:!pandoc sp.md -o sp.html<CR> 344 │ augroup END 345 │ 346 │ " Display setup 347 │ " ============== 348 │ colorscheme termschool 349 │ :set guioptions-=r "remove right-hand scroll bar 350 │ set background=dark " Modify for dark background 351 │ "set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [POS=%04l,%04v][%p%%]\ [LEN=%L] 352 │ "au InsertEnter * hi StatusLine term=reverse ctermbg=5 gui=undercurl guisp=Magenta 353 │ "au InsertLeave * hi StatusLine term=reverse ctermfg=0 ctermbg=2 gui=bold,reverse 354 │ 355 │ " using Source Code Pro 356 │ set anti enc=utf-8 357 │ set guifont=Source\ Code\ Pro\ 16 358 │ filetype plugin on 359 │ syntax on 360 │ set conceallevel=2 361 │ 362 │ " Set style for spelling errors 363 │ hi clear SpellBad 364 │ hi SpellBad cterm=reverse 365 │ hi SpellBad gui=reverse 366 │ 367 │ " Macros 368 │ " ====== 369 │ map j gj 370 │ map k gk 371 │ map <leader>a <ESC>A [AW](#archaic) [NA](#names)<ESC>0n 372 │ map <leader>l <ESC>:term ++close lu <c-r><c-w><CR> 373 │ map <leader>N <ESC>:set nu! rnu!<CR> 374 │ map <leader>pb 0i<p class="blue"><ESC>A</p><ESC> 375 │ map <leader>pg 0i<p class="green"><ESC>A</p><ESC> 376 │ map <leader>pr 0i<p class="red"><ESC>A</p><ESC> 377 │ map <leader>py 0i<p class="yellow"><ESC>A</p><ESC> 378 │ map <leader>qn :tabedit ~/Documents/jots/scratch.md<CR> 379 │ " vim-powered terminal in split window 380 │ map <Leader>t :term ++close<cr> 381 │ tmap <Leader>t <c-w>:term ++close<cr> 382 │ 383 │ " vim-powered terminal in new tab 384 │ map <Leader>T :tab term ++close<cr> 385 │ tmap <Leader>T <c-w>:tab term ++close<cr> 386 │ map <leader>v :tabedit $MYVIMRC<CR> 387 │ map <leader>wb <ESC>:!epy ~/Documents/books/tech/dev-bash/bash-pocket-reference.epub<CR> 388 │ map <leader>wh <ESC>:!epy ~/Documents/books/tech/dev-web/oreilly-html-and-css-the-good-parts-by-the-good-parts.epub<CR> 389 │ noremap <space> za " space open/closes folds 390 │ noremap H :set hlsearch!<CR> 391 │ 392 │ " HTML 393 │ " ---- 394 │ " Highlite in blue (Ruckman) or yellow (mine) or green X-ref 395 │ map <C-b> 0i<mark class="blue"><ESC>A</mark><ESC>03j 396 │ map <C-y> 0i<mark class="yellow"><ESC>A</mark><ESC>03j 397 │ map <A-g> 0i<mark class="green";<ESC>A</mark><ESC>0 398 │ map <A-r> 0i<mark class="red";<ESC>A</mark><ESC>0 399 │ 400 │ " Function keys 401 │ " ------------- 402 │ 403 │ " <F2> Explorer in newtab 404 │ map <F2> <ESC>:tabe .<CR> 405 │ map! <F2> <ESC>:tabe .<CR> 406 │ 407 │ " This calls my download manager. I make a list in vim, hit F3 and it downloads them. 408 │ map <F3> <ESC>:w ~/Downloads/get.txt<CR>:term ++close /home/mitch/bin/get -d<CR>> 409 │ 410 │ " F4 - autocomplete, backward Insert mode 411 │ inoremap <F4> <C-P> 412 │ 413 │ " F5 - autocomplete, forward Insert mode 414 │ inoremap <F5> <C-N> 415 │ 416 │ " This allows me to insert a Bible quote in to a document. 417 │ map <F6> <ESC>0D<ESC>!!kjv 418 │ map! <F6> <ESC>0D<ESC>:!kjv 419 │ "map! <F6> <ESC>0D<ESC>:.!kjv 420 │ 421 │ " pi take the name of a mp4 or picture file under /var/www and will return html with png 422 │ " created for a markdown document. 423 │ map <F7> <ESC>0D<ESC>:.!pi 424 │ map! <F7> <ESC>0D<ESC>:.!pi 425 │ 426 │ " mkln is "make link" will return markdown formated link with emoji for major 427 │ " file types, and will auto-local file under /var/www. 428 │ map <F8> <ESC>0D<ESC>:.!mkln 429 │ map! <F8> <ESC>0D<ESC>:.!mkln 430 │ 431 │ " Run external compiler (used for CRN’s AV Bible) 432 │ map <F9> <ESC>:w!<ESC>:tab term ++close glow -p %<CR> 433 │ 434 │ " <F10> Place holder 435 │ 436 │ " Open file in current buffer or a new tab via netrw 437 │ map <F12> j<ESC>:r !./ab<CR> 438 │ map! <F12> <ESC>:Files ~<CR> 439 │ 440 │ " Easy tab navigation 441 │ nnoremap <Leader>1 1gt 442 │ nnoremap <Leader>2 2gt 443 │ nnoremap <Leader>3 3gt 444 │ nnoremap <Leader>4 4gt 445 │ nnoremap <Leader>5 5gt 446 │ nnoremap <Leader>6 6gt 447 │ nnoremap <Leader>7 7gt 448 │ nnoremap <Leader>8 8gt 449 │ nnoremap <Leader>9 9gt 450 │ 451 │ 452 │ " ===== new status line ==== 453 │ 454 │ "" This was made by Reddit user u/SamLovesNotion. Also with the help of - https://tdaly.co.uk/projects/vim-statusline-generator/ for learning the syntax. Sorry for English & grammar, this post was made in hurry. 455 │ 456 │ " Images - https://www.reddit.com/r/vim/comments/ld8h2j/i_made_a_status_line_from_scratch_no_plugins_used/ 457 │ " I have used Nerd icon fonts. Icons won't work without them. https://github.com/ryanoasis/nerd-fonts/ 458 │ 459 │ " This statusline looks exactly like Vim Airline (even more customizable & powerful) & loads faster than Vim airline. Only take few ms to load. 460 │ 461 │ " STARTUP TIME - With Vim Airline - ~250ms. With this statusline - ~100ms. Without any statusline - ~98ms. 462 │ 463 │ " Add all of this at the end of your vimrc OR Create separate file like 'statusline.vim' & 'colorsgroup.vim' & source those files in your main vimrc. 464 │ " e.g. source "~/.config/vim/statusline.vim" 465 │ 466 │ 467 │ 468 │ " Color highlighting groups 469 │ " Add this AFTER `colorscheme` option in your vimrc. Otherwise your colorscheme will clear this highlightings. OR use ColorScheme autocommand. VERY IMPORTANT. 470 │ 471 │ " Color pallet 472 │ " Green - #2BBB4F (BG) - #080808 (FG) 473 │ " Blue - #4799EB 474 │ " Violet - #986FEC 475 │ " Yellow - #D7A542 476 │ " Orange - #EB754D 477 │ " Grey1 - #202020 478 │ " Grey - #303030 479 │ 480 │ 481 │ " Define color variables 482 │ let g:StslineColorGreen = "#2BBB4F" 483 │ let g:StslineColorBlue = "#4799EB" 484 │ let g:StslineColorViolet = "#986FEC" 485 │ let g:StslineColorYellow = "#D7A542" 486 │ let g:StslineColorOrange = "#EB754D" 487 │ 488 │ let g:StslineColorLight = "#C0C0C0" 489 │ let g:StslineColorDark = "#080808" 490 │ let g:StslineColorDark1 = "#181818" 491 │ let g:StslineColorDark2 = "#202020" 492 │ let g:StslineColorDark3 = "#303030" 493 │ 494 │ 495 │ " Define colors 496 │ let g:StslineBackColor = g:StslineColorDark2 497 │ let g:StslineOnBackColor = g:StslineColorLight 498 │ "let g:StslinePriColor = g:StslineColorGreen 499 │ let g:StslineOnPriColor = g:StslineColorDark 500 │ let g:StslineSecColor = g:StslineColorDark3 501 │ let g:StslineOnSecColor = g:StslineColorLight 502 │ 503 │ 504 │ " Create highlight groups 505 │ execute 'highlight StslineSecColorFG guifg=' . g:StslineSecColor ' guibg=' . g:StslineBackColor 506 │ execute 'highlight StslineSecColorBG guifg=' . g:StslineColorLight ' guibg=' . g:StslineSecColor 507 │ execute 'highlight StslineBackColorBG guifg=' . g:StslineColorLight ' guibg=' . g:StslineBackColor 508 │ execute 'highlight StslineBackColorFGSecColorBG guifg=' . g:StslineBackColor ' guibg=' . g:StslineSecColor 509 │ execute 'highlight StslineSecColorFGBackColorBG guifg=' . g:StslineSecColor ' guibg=' . g:StslineBackColor 510 │ execute 'highlight StslineModColorFG guifg=' . g:StslineColorYellow ' guibg=' . g:StslineBackColor 511 │ 512 │ 513 │ 514 │ " Statusline 515 │ 516 │ " Enable statusline 517 │ set laststatus=2 518 │ 519 │ " Disable showmode - i.e. Don't show mode like --INSERT-- in current statusline. 520 │ set noshowmode 521 │ 522 │ " Enable GUI colors for terminals (Some terminals may not support this, so you'll have to *manually* set color pallet for tui colors. Lie tuibg=255, tuifg=120, etc.). 523 │ set termguicolors 524 │ 525 │ 526 │ 527 │ " Understand statusline elements 528 │ 529 │ " %{StslineMode()} = Output of a function 530 │ " %#StslinePriColorBG# = Highlight group 531 │ " %F, %c, etc. are variables which contain value like - current file path, current colums, etc. 532 │ " %{&readonly?\"\ \":\"\"} = If file is readonly ? Then "Lock icon" Else : "Nothing" 533 │ " %{get(b:,'coc_git_status',b:GitBranch)} = If b:coc_git_status efists, then it's value, else value of b:GitBranch 534 │ " &filetype, things starting with & are also like variables with info. 535 │ " \ - Is for escaping a space. \" is for escaping a double quote. 536 │ " %{&fenc!='utf-8'?\"\ \":''} = If file encoding is NOT!= 'utf-8' ? THEN output a "Space" else : no character 537 │ 538 │ 539 │ 540 │ " Define active statusline 541 │ 542 │ function! ActivateStatusline() 543 │ call GetFileType() 544 │ setlocal statusline=%#StslinePriColorBG#\ %{StslineMode()}%#StslineSecColorBG#%{get(b:,'coc_git_status',b:GitBranch)}%{get(b:,'coc_git_blame','')}%#StslineBackColorFGPriColorBG#%#StslinePriColorFG#\ %{&readonly?\"\ \":\"\"}%F\ %#StslineModColorFG#%{&modified?\"\ \":\"\"}%=%#StslinePriColorFG#\ %{b:FiletypeIcon}%{&filetype}\ %#StslineSecColorFG#%#StslineSecColorBG#%{&fenc!='utf-8'?\"\ \":''}%{&fenc!='utf-8'?&fenc:''}%{&fenc!='utf-8'?\"\ \":''}%#StslinePriColorFGSecColorBG#%#StslinePriColorBG#\ %p\%%\ %#StslinePriColorBGBold#%l%#StslinePriColorBG#/%L\ :%c\ 545 │ endfunction 546 │ 547 │ 548 │ 549 │ " Define Inactive statusline 550 │ 551 │ function! DeactivateStatusline() 552 │ 553 │ if !exists("b:GitBranch") || b:GitBranch == '' 554 │ setlocal statusline=%#StslineSecColorBG#\ INACTIVE\ %#StslineSecColorBG#%{get(b:,'coc_git_statusline',b:GitBranch)}%{get(b:,'coc_git_blame','')}%#StslineBackColorFGSecColorBG#%#StslineBackColorBG#\ %{&readonly?\"\ \":\"\"}%F\ %#StslineModColorFG#%{&modified?\"\ \":\"\"}%=%#StslineBackColorBG#\ %{b:FiletypeIcon}%{&filetype}\ %#StslineSecColorFGBackColorBG#%#StslineSecColorBG#\ %p\%%\ %l/%L\ :%c\ 555 │ 556 │ else 557 │ setlocal statusline=%#StslineSecColorBG#%{get(b:,'coc_git_statusline',b:GitBranch)}%{get(b:,'coc_git_blame','')}%#StslineBackColorFGSecColorBG#%#StslineBackColorBG#\ %{&readonly?\"\ \":\"\"}%F\ %#StslineModColorFG#%{&modified?\"\ \":\"\"}%=%#StslineBackColorBG#\ %{b:FiletypeIcon}%{&filetype}\ %#StslineSecColorFGBackColorBG#%#StslineSecColorBG#\ %p\%%\ %l/%L\ :%c\ 558 │ endif 559 │ 560 │ endfunction 561 │ 562 │ 563 │ 564 │ " Get Statusline mode & also set primary color for that mode 565 │ function! StslineMode() 566 │ 567 │ let l:CurrentMode=mode() 568 │ 569 │ if l:CurrentMode==#"n" 570 │ let g:StslinePriColor = g:StslineColorGreen 571 │ let b:CurrentMode = "NORMAL " 572 │ 573 │ elseif l:CurrentMode==#"i" 574 │ let g:StslinePriColor = g:StslineColorViolet 575 │ let b:CurrentMode = "INSERT " 576 │ 577 │ elseif l:CurrentMode==#"c" 578 │ let g:StslinePriColor = g:StslineColorYellow 579 │ 580 │ let b:CurrentMode = "COMMAND " 581 │ 582 │ elseif l:CurrentMode==#"v" 583 │ let g:StslinePriColor = g:StslineColorBlue 584 │ let b:CurrentMode = "VISUAL " 585 │ 586 │ elseif l:CurrentMode==#"V" 587 │ let g:StslinePriColor = g:StslineColorBlue 588 │ let b:CurrentMode = "V-LINE " 589 │ 590 │ elseif l:CurrentMode==#"\<C-v>" 591 │ let g:StslinePriColor = g:StslineColorBlue 592 │ let b:CurrentMode = "V-BLOCK " 593 │ 594 │ elseif l:CurrentMode==#"R" 595 │ let g:StslinePriColor = g:StslineColorViolet 596 │ let b:CurrentMode = "REPLACE " 597 │ 598 │ elseif l:CurrentMode==#"s" 599 │ let g:StslinePriColor = g:StslineColorBlue 600 │ let b:CurrentMode = "SELECT " 601 │ 602 │ elseif l:CurrentMode==#"t" 603 │ let g:StslinePriColor =g:StslineColorYellow 604 │ let b:CurrentMode = "TERM " 605 │ 606 │ elseif l:CurrentMode==#"!" 607 │ let g:StslinePriColor = g:StslineColorYellow 608 │ let b:CurrentMode = "SHELL " 609 │ 610 │ endif 611 │ 612 │ 613 │ call UpdateStslineColors() 614 │ 615 │ return b:CurrentMode 616 │ 617 │ endfunction 618 │ 619 │ 620 │ 621 │ " Update colors. Recreate highlight groups with new Primary color value. 622 │ function! UpdateStslineColors() 623 │ 624 │ execute 'highlight StslinePriColorBG guifg=' . g:StslineOnPriColor ' guibg=' . g:StslinePriColor 625 │ execute 'highlight StslinePriColorBGBold guifg=' . g:StslineOnPriColor ' guibg=' . g:StslinePriColor ' gui=bold' 626 │ execute 'highlight StslinePriColorFG guifg=' . g:StslinePriColor ' guibg=' . g:StslineBackColor 627 │ execute 'highlight StslinePriColorFGSecColorBG guifg=' . g:StslinePriColor ' guibg=' . g:StslineSecColor 628 │ execute 'highlight StslineSecColorFGPriColorBG guifg=' . g:StslineSecColor ' guibg=' . g:StslinePriColor 629 │ 630 │ if !exists("b:GitBranch") || b:GitBranch == '' 631 │ execute 'highlight StslineBackColorFGPriColorBG guifg=' . g:StslineBackColor ' guibg=' . g:StslinePriColor 632 │ endif 633 │ 634 │ endfunction 635 │ 636 │ 637 │ 638 │ " Get git branch name 639 │ 640 │ function! GetGitBranch() 641 │ let b:GitBranch="" 642 │ try 643 │ let l:dir=expand('%:p:h') 644 │ let l:gitrevparse = system("git -C ".l:dir." rev-parse --abbrev-ref HEAD") 645 │ if !v:shell_error 646 │ let b:GitBranch=" ".substitute(l:gitrevparse, '\n', '', 'g')." " 647 │ execute 'highlight StslineBackColorFGPriColorBG guifg=' . g:StslineBackColor ' guibg=' . g:StslineSecColor 648 │ endif 649 │ catch 650 │ endtry 651 │ endfunction 652 │ 653 │ 654 │ 655 │ " Get filetype & custom icon. Put your most used file types first for optimized performance. 656 │ 657 │ function! GetFileType() 658 │ 659 │ if &filetype == 'typescript' 660 │ let b:FiletypeIcon = ' ' 661 │ 662 │ elseif &filetype == 'html' 663 │ let b:FiletypeIcon = ' ' 664 │ 665 │ elseif &filetype == 'scss' 666 │ let b:FiletypeIcon = ' ' 667 │ 668 │ elseif &filetype == 'css' 669 │ let b:FiletypeIcon = ' ' 670 │ 671 │ elseif &filetype == 'javascript' 672 │ let b:FiletypeIcon = ' ' 673 │ 674 │ elseif &filetype == 'javascriptreact' 675 │ let b:FiletypeIcon = ' ' 676 │ 677 │ elseif &filetype == 'markdown' 678 │ let b:FiletypeIcon = ' ' 679 │ 680 │ elseif &filetype == 'sh' || &filetype == 'zsh' 681 │ let b:FiletypeIcon = ' ' 682 │ 683 │ elseif &filetype == 'vim' 684 │ let b:FiletypeIcon = ' ' 685 │ 686 │ elseif &filetype == '' 687 │ let b:FiletypeIcon = '' 688 │ 689 │ elseif &filetype == 'rust' 690 │ let b:FiletypeIcon = ' ' 691 │ 692 │ elseif &filetype == 'ruby' 693 │ let b:FiletypeIcon = ' ' 694 │ 695 │ elseif &filetype == 'cpp' 696 │ let b:FiletypeIcon = ' ' 697 │ 698 │ elseif &filetype == 'c' 699 │ let b:FiletypeIcon = ' ' 700 │ 701 │ elseif &filetype == 'go' 702 │ let b:FiletypeIcon = ' ' 703 │ 704 │ elseif &filetype == 'lua' 705 │ let b:FiletypeIcon = ' ' 706 │ 707 │ elseif &filetype == 'haskel' 708 │ let b:FiletypeIcon = ' ' 709 │ 710 │ else 711 │ let b:FiletypeIcon = '🖊 ' 712 │ 713 │ endif 714 │ endfunction 715 │ 716 │ 717 │ 718 │ " Get git branch name after entering a buffer 719 │ augroup GetGitBranch 720 │ autocmd! 721 │ autocmd BufEnter * call GetGitBranch() 722 │ augroup END 723 │ 724 │ 725 │ " Set active / inactive statusline after entering, leaving buffer 726 │ augroup SetStslineline 727 │ autocmd! 728 │ autocmd BufEnter,WinEnter * call ActivateStatusline() 729 │ autocmd BufLeave,WinLeave * call DeactivateStatusline() 730 │ augroup END 731 │ 732 │ " vim: nospell ───────┴────────────────────────────────────────────────────────────────────────