Skip to content

Instantly share code, notes, and snippets.

@Starsign68
Last active May 27, 2021 01:10
Show Gist options
  • Save Starsign68/40e14664ac014f72aec3d7a0bcd8c76a to your computer and use it in GitHub Desktop.
Save Starsign68/40e14664ac014f72aec3d7a0bcd8c76a to your computer and use it in GitHub Desktop.
Minimal VIMRC
" +=========================+
" | 2021-05-26 | Starsign68 |
" +=========================+
let mapleader = " "
let localleader = ''
let g:netrw_banner = 0
let g:netrw_liststyle = 0
set termencoding=utf-8
let g:doSmartTab='N'
" {{{{STATUSLIME}
let g:currentmode = { 'n': 'NORMAL', 'no': 'N·OP·PEND', 'v': 'VISUAL', 'V': 'V·LINE', '': 'V·BLOCK', 's': 'SELECT', 'S': 'S·LINE', '': 'S·BLOCK', 'i': 'INSERT', 'R': 'REPLACE', 'Rv': 'V·REPLACE', 'c': 'COMMAND', 'cv': 'VIM EX', 'ce': 'EX', 'r': 'PROMPT', 'rm': 'MORE', 'r?': 'CONFIRM', '!': 'SHELL', 't': 'TERMINAL'}
let g:modegroups = { 'n': 'NORMAL', 'no': 'NORMAL', 'v': 'VISUAL', 'V': 'VISUAL', '': 'VISUAL', 's': 'OTHER', 'S': 'OTHER', '': 'OTHER', 'i': 'INSERT', 'R': 'INSERT', 'Rv': 'INSERT', 'c': 'OTHER', 'cv': 'OTHER', 'ce': 'OTHER', 'r': 'OTHER', 'rm': 'OTHER', 'r?': 'OTHER', '!': 'OTHER', 't': 'OTHER'}
function! Modetheme(group)
if g:modegroups[mode()]==a:group
let g:colthm = g:currentmode[mode()]
let g:limeModes = g:colthm
return " ".g:limeModes." "
else
return ''
endif
endfunction
set statusline=
set statusline+=%3*%{(Modetheme('NORMAL'))}
set statusline+=%7*%{(Modetheme('VISUAL'))}
set statusline+=%5*%{(Modetheme('INSERT'))}
set statusline+=%1*%{(Modetheme('OTHER'))}
set statusline+=%1*
set statusline+=%{&paste?'\ PST':''} " paste
set statusline+=%{&spell?'\ SPL':''} " spell
set statusline+=\ "space
set statusline+=%(%8*%m%1*\ %) " modified [+] / [-] flag
set statusline+=[%Y] " file type
set statusline+=\ %t " short file name
set statusline+=%1*
set statusline+=%= " right align
set statusline+=%1* " color
set statusline+=\ "space
set statusline+=[%{strftime(\"%H:%M\")}]\ " time
set statusline+=[%1.5l:%1.5L] " [%3p%%]
" {STATUSLIME}}}}
" {{{{Settings}
filetype plugin indent on " Enable filetype-specific settings.
set guicursor=n-v-c:block-Cursor/lCursor,ve:ver35-Cursor,o:hor50-Cursor,i-ci:ver15-Cursor/lCursor,r-cr:hor20-Cursor/lCursor,sm:block-Cursor-blinkwait175-blinkoff150-blinkon175
set backspace=indent,start,eol
set hidden
set noshowmode " Don't show the mode when status line shows it
set number " Show line numbers
set noshowcmd " Don't show the CMD
set linebreak " Break lines at word (requires Wrap lines)
set showbreak=\|\ " Wrap-broken line prefix
set textwidth=150 " Line wrap (number of cols)
set showmatch " Highlight matching brace
set visualbell " Use visual bell (no beeping)
set noswapfile " Save space
set incsearch " Searches for strings incrementally
set shiftwidth=3 " Number of auto-indent spaces
set smartindent " Enable smart-indent
set smarttab " Enable smart-tabs
set expandtab
set wildmenu
" {SETTINGS}}}
" {{{{TRIGGERS}
" [Lines]
augroup cline
au!
au WinLeave,InsertEnter * set nocursorline
au VimEnter,WinEnter,InsertLeave * set cursorline
augroup END
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
" [Colors]
aug COLOR
au!
au ColorScheme,FocusGained * hi LimeStatusLine cterm=none ctermfg=235 ctermbg=254 guifg=#272727 guibg=#C8C8C8 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineNC cterm=none ctermfg=246 ctermbg=251 guifg=#909090 guibg=#c8c8c8 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineMode cterm=bold ctermfg=30 ctermbg=254 guifg=#2e3440 guibg=#AFE805 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineModeLight cterm=bold ctermfg=30 ctermbg=254 guifg=#ECEFF4 guibg=#8BB804 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineModeInsert cterm=bold ctermfg=166 ctermbg=254 guifg=#2E3440 guibg=#F59C00 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineModeInsertLight cterm=bold ctermfg=166 ctermbg=254 guifg=#ECEFF4 guibg=#FF6B12 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineModeVisual cterm=bold ctermfg=166 ctermbg=254 guifg=#2e3440 guibg=#3BC8F7 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineModeVisualLight cterm=bold ctermfg=166 ctermbg=254 guifg=#ECEFF4 guibg=#037499 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineFileModified cterm=bold ctermfg=30 ctermbg=254 guifg=#228080 guibg=#e8e8e8 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineFileRO cterm=bold ctermfg=167 ctermbg=254 guifg=#e5786d guibg=#e8e8e8 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineSeparator cterm=none ctermfg=243 ctermbg=254 guifg=#777777 guibg=#e8e8e8 gui=none
au ColorScheme,FocusGained * hi LimeStatusLinePosition cterm=bold ctermfg=235 ctermbg=254 guifg=#272727 guibg=#e8e8e8 gui=bold
au ColorScheme,FocusGained * hi User1 cterm=bold ctermfg=235 ctermbg=254 guifg=#ECEFF4 guibg=#2C323C gui=bold
au ColorScheme,FocusGained * hi User2 cterm=bold ctermfg=246 ctermbg=251 guifg=#909090 guibg=#c8c8c8 gui=bold
au ColorScheme,FocusGained * hi User3 cterm=bold ctermfg=30 ctermbg=254 guifg=#2e3440 guibg=#AFE805 gui=bold
au ColorScheme,FocusGained * hi User4 cterm=bold ctermfg=30 ctermbg=254 guifg=#ECEFF4 guibg=#8BB804 gui=bold
au ColorScheme,FocusGained * hi User5 cterm=bold ctermfg=166 ctermbg=254 guifg=#2E3440 guibg=#F59C00 gui=bold
au ColorScheme,FocusGained * hi User6 cterm=bold ctermfg=166 ctermbg=254 guifg=#ECEFF4 guibg=#FF6B12 gui=bold
au ColorScheme,FocusGained * hi User7 cterm=bold ctermfg=166 ctermbg=254 guifg=#2e3440 guibg=#3BC8F7 gui=bold
au ColorScheme,FocusGained * hi User8 cterm=bold ctermfg=166 ctermbg=254 guifg=#ECEFF4 guibg=#037499 gui=bold
aug END
" {TRIGGERS}}}}
" {{{{THEME}
syntax on
set termguicolors
let g:tokyonight_style = 'night' " available: night, storm
let g:tokyonight_disable_italic = 1
let g:tokyonight_cursor = 'blue'
colorscheme tokyonight
set background=dark
" {THEME}}}}
" {{{{NAVIGATION & UI}
iabbrev ddate <C-R>=strftime("%Y-%m-%d")<CR>
nnoremap <F1> :set guifont=:h14<CR>
nnoremap <S-F1> :set guifont=:h15<CR>
nnoremap <F2> :e home/web_user/.vim/vimrc<CR>
nnoremap <S-F2> :w<CR> :so home/web_user/.vim/vimrc<CR>
nnoremap <F3> :w<CR> :so %<CR>
nnoremap <S-F3> :w<CR> :export %<CR>
nnoremap <left> <nop>
nnoremap <right> <nop>
nnoremap <up> <nop>
nnoremap <down> <nop>
noremap <leader>yo "*y
nnoremap <leader>po "*p
nnoremap Q @@
nnoremap K k
vnoremap K k
" {NAVIGATION & UI}}}}
let mapleader = ','
let localleader = ''
encoding utf-8
let g:netrw_banner = 0
let g:netrw_liststyle = 0
let g:netrw_browse_split = 0
let g:netrw_altv = 1
let g:netrw_winsize = 10
let g:currentmode = {'n' : 'NORMAL', 'no': 'N·OP·PEND', 'v': 'VISUAL', 'V': 'V·LINE', '': 'V·BLOCK', 's': 'SELECT', 'S': 'S·LINE', '': 'S·BLOCK', 'i': 'INSERT', 'R': 'REPLACE', 'Rv': 'V·REPLACE', 'c': 'COMMAND', 'cv': 'VIM EX', 'ce': 'EX', 'r': 'PROMPT', 'rm': 'MORE', 'r?': 'CONFIRM', '!': 'SHELL', 't': 'TERMINAL'}
let g:modegroups = {'n': 'NORMAL', 'no': 'NORMAL', 'v': 'VISUAL', 'V': 'VISUAL', '': 'VISUAL', 's': 'OTHER', 'S': 'OTHER', '': 'OTHER', 'i': 'INSERT', 'R': 'INSERT', 'Rv': 'INSERT', 'c': 'OTHER', 'cv': 'OTHER', 'ce': 'OTHER', 'r': 'OTHER', 'rm': 'OTHER', 'r?': 'OTHER', '!': 'OTHER', 't': 'OTHER'}
function! Modetheme(group)
if g:modegroups[mode()]==a:group
let g:colthm = g:currentmode[mode()]
let g:limeModes = g:colthm
return " ".g:limeModes." "
else
return ''
endif
endfunction
set stl=
set stl+=%3*%{(Modetheme('NORMAL'))}%7*%{(Modetheme('VISUAL'))}%5*%{(Modetheme('INSERT'))}%1*%{(Modetheme('OTHER'))}%1*%n%{&paste?' PST':''}%{&spell?' SPL':''} %(%8*%m%1* %)[%Y] %t%1 %=%#COLPREV#[TEXT]%1*[%{strftime("%H:%M")}] [%1.5l:%1.5L]
set backspace=indent,start,eol
set hidden
set noshowmode
set number
set noshowcmd
set linebreak
set showbreak=[...]
set textwidth=150
set showmatch
set visualbell
filetype plugin indent on
set noswapfile
set smartcase
set incsearch
set autoindent
set shiftwidth=2
set smartindent
set smarttab
set et 1
set wildmenu
iabbrev ddate <C-R>=strftime("%Y-%m-%d")<CR>
augroup cline
au!
au WinLeave * set nocursorline
au WinEnter * set cursorline
au InsertEnter * set nocursorline
au InsertLeave * set cursorline
augroup END
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
aug COLOR
au!
au ColorScheme,FocusGained * hi LimeStatusLine cterm=none ctermfg=235 ctermbg=254 guifg=#272727 guibg=#C8C8C8 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineNC cterm=none ctermfg=246 ctermbg=251 guifg=#909090 guibg=#c8c8c8 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineMode cterm=bold ctermfg=30 ctermbg=254 guifg=#2e3440 guibg=#AFE805 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineModeLight cterm=bold ctermfg=30 ctermbg=254 guifg=#ECEFF4 guibg=#8BB804 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineModeInsert cterm=bold ctermfg=166 ctermbg=254 guifg=#2E3440 guibg=#F59C00 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineModeInsertLight cterm=bold ctermfg=166 ctermbg=254 guifg=#ECEFF4 guibg=#FF6B12 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineModeVisual cterm=bold ctermfg=166 ctermbg=254 guifg=#2e3440 guibg=#3BC8F7 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineModeVisualLight cterm=bold ctermfg=166 ctermbg=254 guifg=#ECEFF4 guibg=#037499 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineFileModified cterm=bold ctermfg=30 ctermbg=254 guifg=#228080 guibg=#e8e8e8 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineFileRO cterm=bold ctermfg=167 ctermbg=254 guifg=#e5786d guibg=#e8e8e8 gui=bold
au ColorScheme,FocusGained * hi LimeStatusLineSeparator cterm=none ctermfg=243 ctermbg=254 guifg=#777777 guibg=#e8e8e8 gui=none
au ColorScheme,FocusGained * hi LimeStatusLinePosition cterm=bold ctermfg=235 ctermbg=254 guifg=#272727 guibg=#e8e8e8 gui=bold
au ColorScheme,FocusGained * hi User1 cterm=bold ctermfg=235 ctermbg=254 guifg=#ECEFF4 guibg=#2C323C gui=bold
au ColorScheme,FocusGained * hi User2 cterm=bold ctermfg=246 ctermbg=251 guifg=#909090 guibg=#c8c8c8 gui=bold
au ColorScheme,FocusGained * hi User3 cterm=bold ctermfg=30 ctermbg=254 guifg=#2e3440 guibg=#AFE805 gui=bold
au ColorScheme,FocusGained * hi User4 cterm=bold ctermfg=30 ctermbg=254 guifg=#ECEFF4 guibg=#8BB804 gui=bold
au ColorScheme,FocusGained * hi User5 cterm=bold ctermfg=166 ctermbg=254 guifg=#2E3440 guibg=#F59C00 gui=bold
au ColorScheme,FocusGained * hi User6 cterm=bold ctermfg=166 ctermbg=254 guifg=#ECEFF4 guibg=#FF6B12 gui=bold
au ColorScheme,FocusGained * hi User7 cterm=bold ctermfg=166 ctermbg=254 guifg=#2e3440 guibg=#3BC8F7 gui=bold
au ColorScheme,FocusGained * hi User8 cterm=bold ctermfg=166 ctermbg=254 guifg=#ECEFF4 guibg=#037499 gui=bold
aug END
syntax on
set termguicolors
let g:tokyonight_style = 'night'
let g:tokyonight_disable_italic = 1
let g:tokyonight_cursor = 'blue'
colorscheme tokyonight
set background=dark
noremap <left> <nop>
noremap <up> <nop>
noremap <down> <nop>
noremap <right> <nop>
vnoremap <leader>yo "*y
nnoremap <leader>po "*p
nnoremap <F3> :hi COLPREV guibg=<C-r>=expand("<cword>")<cr><cr>
nnoremap Q @@
nnoremap K k
vnoremap K k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment