Last active
December 17, 2021 12:43
-
-
Save zfarbp/78cf5640e38e0894a3be53cbe13fa9b8 to your computer and use it in GitHub Desktop.
vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" __Required Plugins__ " | |
" - https://github.com/jistr/vim-nerdtree-tabs " | |
" - https://github.com/tpope/vim-pathogen " | |
" - https://github.com/preservim/nerdtree " | |
" - https://github.com/pangloss/vim-javascript " | |
" - https://github.com/itchyny/lightline.vim " | |
" - https://github.com/airblade/vim-gitgutter " | |
" - https://github.com/mileszs/ack.vim " | |
" - https://github.com/junegunn/fzf " | |
" - https://github.com/sharkdp/fd " | |
" Plugins { | |
set rtp+=/usr/local/opt/fzf | |
nnoremap <silent> <C-p> :FZF<CR> | |
autocmd vimenter * NERDTree | |
call pathogen#infect() | |
call plug#begin() | |
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' } | |
Plug 'sebdah/vim-delve' | |
call plug#end() | |
" } | |
" General { | |
set nocompatible | |
set updatetime=100 | |
set history=9999 | |
if !isdirectory($HOME."/.vim/undo-dir") | |
call mkdir($HOME."/.vim/undo-dir", "p", 0700) | |
endif | |
set undodir=~/.vim/undo-dir | |
set undofile | |
set hidden | |
set encoding=utf-8 | |
filetype plugin indent on | |
" } | |
" UI { | |
syntax on | |
set nu | |
set autoindent | |
set shiftwidth=2 | |
set softtabstop=2 | |
set expandtab | |
set splitright | |
set noshowmode | |
set laststatus=2 | |
" } | |
" When editing a file, always jump to the last known cursor position. Don't | |
" do it when the position is invalid or when inside an event handler (happens | |
" when dropping a file on gvim). Also don't do it when the mark is in the | |
" first line, that is the default position when opening a file. { | |
autocmd BufReadPost * | |
\ if line("'\"") > 1 && line("'\"") <= line("$") | | |
\ exe "normal! g`\"" | | |
\ endif | |
" } | |
" Folding { | |
set foldenable " turn on folding | |
set foldmethod=syntax "fold on markers | |
set foldlevel=100 " don't autofold anything | |
set foldopen=block,hor,mark,percent,quickfix,tag " what movements open folds | |
nnoremap cof :call FoldColumnToggle()<cr> | |
function! FoldColumnToggle() | |
if &foldcolumn | |
setlocal foldcolumn=0 | |
else | |
setlocal foldcolumn=1 | |
endif | |
endfunction | |
" } | |
" Mappings { | |
let mapleader = "\<SPACE>" | |
let maplocalleader = "," | |
" Toggle between tabs " | |
nnoremap <C-Left> :tabprevious<CR> | |
nnoremap <C-Right> :tabnext<CR> | |
" Toggle NERDTree " | |
nnoremap <C-n> :NERDTreeTabsToggle<CR> | |
" Move lines down/up " | |
nnoremap <C-j> :m .+1<CR>== | |
nnoremap <C-k> :m .-2<CR>== | |
inoremap <C-j> <Esc>:m .+1<CR>==gi | |
inoremap <C-k> <Esc>:m .-2<CR>==gi | |
vnoremap <C-j> :m '>+1<CR>gv=gv | |
vnoremap <C-k> :m '<-2<CR>gv=gv | |
" Don't use Ex mode, use Q for formatting | |
noremap Q gq | |
" Join lines and restore cursor location (J) | |
nnoremap J :call Preserve("join")<CR> | |
" Buffer navigation | |
nnoremap <leader>; <C-^> | |
:map <leader>] :bnext<CR> | |
:map <leader>[ :bprev<CR> | |
nnoremap <leader>ls :Buffers<CR> | |
nnoremap <leader>dd :bd<CR> | |
" strip trailing whitespace | |
nnoremap _$ :call Preserve("%s/\\s\\+$//e")<CR> | |
" } | |
" Commands { | |
" :b - bash " | |
cabbrev b term /bin/bash --rcfile ~/.profile | |
" } | |
" Templating { | |
" lightline configuration " | |
let g:lightline = { | |
\ 'colorscheme': 'zfarbp_lightline_theme', | |
\ } | |
hi clear | |
let g:colors_name="PurpleIce" | |
hi Normal ctermfg=252 ctermbg=0 | |
hi CursorLine ctermbg=234 cterm=none | |
hi CursorLineNr ctermfg=208 cterm=none | |
hi Boolean ctermfg=135 | |
hi Character ctermfg=144 | |
hi Number ctermfg=135 | |
hi String ctermfg=133 | |
hi Conditional ctermfg=161 cterm=bold | |
hi Constant ctermfg=135 cterm=bold | |
hi Cursor ctermfg=16 ctermbg=253 | |
hi Debug ctermfg=225 cterm=bold | |
hi Define ctermfg=81 | |
hi Delimiter ctermfg=241 | |
hi DiffAdd ctermbg=24 | |
hi DiffChange ctermfg=181 ctermbg=239 | |
hi DiffDelete ctermfg=162 ctermbg=53 | |
hi DiffText ctermbg=102 cterm=bold | |
hi Directory ctermfg=135 cterm=bold | |
hi Error ctermfg=255 ctermbg=89 | |
hi ErrorMsg ctermfg=255 ctermbg=16 cterm=bold | |
hi Exception ctermfg=118 cterm=bold | |
hi Float ctermfg=135 | |
hi FoldColumn ctermfg=67 ctermbg=16 | |
hi Folded ctermfg=67 ctermbg=16 | |
hi Function ctermfg=44 cterm=bold | |
hi Identifier ctermfg=122 cterm=none | |
hi Ignore ctermfg=244 ctermbg=232 | |
hi IncSearch ctermfg=193 ctermbg=16 | |
hi keyword ctermfg=126 cterm=bold | |
hi Label ctermfg=161 cterm=none | |
hi Macro ctermfg=193 | |
hi SpecialKey ctermfg=81 | |
hi MatchParen ctermfg=233 ctermbg=208 cterm=bold | |
hi ModeMsg ctermfg=229 | |
hi MoreMsg ctermfg=229 | |
hi Operator ctermfg=161 | |
" complete menu | |
hi Pmenu ctermfg=81 ctermbg=16 | |
hi PmenuSel ctermfg=255 ctermbg=242 | |
hi PmenuSbar ctermbg=232 | |
hi PmenuThumb ctermfg=81 | |
hi PreCondit ctermfg=118 cterm=bold | |
hi PreProc ctermfg=118 | |
hi Question ctermfg=81 | |
hi Repeat ctermfg=161 cterm=bold | |
hi Search ctermfg=0 ctermbg=222 cterm=NONE | |
" marks column | |
hi SignColumn ctermfg=118 ctermbg=235 | |
hi SpecialChar ctermfg=161 cterm=bold | |
hi SpecialComment ctermfg=245 cterm=bold | |
hi Special ctermfg=81 | |
if has("spell") | |
hi SpellBad ctermbg=52 | |
hi SpellCap ctermbg=17 | |
hi SpellLocal ctermbg=17 | |
hi SpellRare ctermfg=none ctermbg=none cterm=reverse | |
endif | |
hi Statement ctermfg=161 cterm=bold | |
hi StatusLine ctermfg=238 ctermbg=253 | |
hi StatusLineNC ctermfg=244 ctermbg=232 | |
hi StorageClass ctermfg=121 | |
hi Structure ctermfg=81 | |
hi Tag ctermfg=161 | |
hi Title ctermfg=123 | |
hi Todo ctermfg=119 ctermbg=232 cterm=bold | |
hi Typedef ctermfg=81 | |
hi Type ctermfg=81 cterm=none | |
hi Underlined ctermfg=244 cterm=underline | |
hi VertSplit ctermfg=244 ctermbg=232 cterm=bold | |
hi VisualNOS ctermbg=238 | |
hi Visual ctermbg=235 | |
hi WarningMsg ctermfg=231 ctermbg=238 cterm=bold | |
hi WildMenu ctermfg=81 ctermbg=16 | |
hi Comment ctermfg=240 ctermbg=0 | |
hi CursorColumn ctermbg=236 | |
hi ColorColumn ctermbg=236 | |
hi LineNr ctermfg=135 ctermbg=0 | |
hi NonText ctermfg=59 | |
hi SpecialKey ctermfg=59 | |
set background=dark | |
" vim-gitgutter " | |
highlight GitGutterAdd ctermfg=135 | |
highlight GitGutterChange ctermfg=85 | |
highlight GitGutterDelete ctermfg=125 | |
" vim-go specifc " | |
highlight goComment ctermfg=240 | |
highlight goPackage ctermfg=201 | |
highlight goImport ctermfg=201 | |
highlight goStatement ctermfg=121 | |
highlight goString ctermfg=134 | |
highlight goType ctermfg=199 | |
highlight goFunction ctermfg=44 cterm=bold | |
highlight goLabel ctermfg=140 | |
highlight goConditional ctermfg=84 | |
highlight goRepeat ctermfg=121 | |
highlight goBuiltins ctermfg=84 | |
" vim-javascript specific " | |
let g:javascript_plugin_jsdoc = 1 | |
" NERDTree specific " | |
let NERDTreeShowHidden=1 | |
" fzf colors " | |
let g:fzf_colors = | |
\ { 'fg': ['fg', 'Normal'], | |
\ 'bg': ['bg', 'Normal'], | |
\ 'hl': ['fg', 'LineNr'], | |
\ 'fg+': ['fg', 'Comment', 'CursorColumn', 'Normal'], | |
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], | |
\ 'hl+': ['fg', 'Statement'], | |
\ 'info': ['fg', 'PreProc'], | |
\ 'border': ['fg', 'Delimiter'], | |
\ 'prompt': ['fg', 'LineNr'], | |
\ 'pointer': ['fg', 'LineNr'], | |
\ 'marker': ['fg', 'Keyword'], | |
\ 'spinner': ['fg', 'Label'], | |
\ 'header': ['fg', 'LineNr'] } | |
" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
zfarbp_lightline_theme
https://gist.github.com/zfarbp/cb26437c0c4fdab924e0374dd29f0ce9