Last active
October 29, 2022 03:39
-
-
Save diegoulloao/a2e4984a0bc0b9a07103da675e9cc6e3 to your computer and use it in GitHub Desktop.
My vim conf
This file contains hidden or 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
" __ __ _____ _____ ____ _ ______ _____ | |
" \ \ / /\ | __ \|_ _| /\ | _ \| | | ____|/ ____| | |
" \ \ / / \ | |__) | | | / \ | |_) | | | |__ | (___ | |
" \ \/ / /\ \ | _ / | | / /\ \ | _ <| | | __| \___ \ | |
" \ / ____ \| | \ \ _| |_ / ____ \| |_) | |____| |____ ____) | | |
" \/_/ \_\_| \_\_____/_/ \_\____/|______|______|_____/ | |
let theme="farout" | |
" theme list: gruvbox|ayu|pop-punk|fahrenheit|farout | |
" -------------------------------------------------------------------------------------- | |
" __ _______ __ __ | |
" \ \ / /_ _| \/ | | |
" \ \ / / | | | \ / | | |
" \ \/ / | | | |\/| | | |
" \ / _| |_| | | | | |
" \/ |_____|_| |_| | |
syntax on | |
set cursorline | |
set number | |
set ruler | |
set relativenumber | |
set showmatch | |
set noshowmode | |
set expandtab | |
set autoindent | |
set smartindent | |
set ignorecase | |
set nobackup | |
set splitbelow | |
set splitright | |
set termguicolors | |
set tabstop=2 | |
set shiftwidth=2 | |
set mouse=a | |
set numberwidth=1 | |
set clipboard=unnamed | |
set encoding=utf-8 | |
set laststatus=2 | |
set foldmethod=marker | |
set foldmarker={,} | |
set foldlevelstart=99 | |
set wildignore+=*/tmp/*,git/*,*.so,*.swp,*.zip,*.DS_Store,*/.vscode/*,*/node_modules/* | |
highlight link Searchlight Incsearch | |
" -------------------------------------------------------------------------------------- | |
" _____ _ _ _ _____ _____ _ _ _____ | |
" | __ \| | | | | |/ ____|_ _| \ | |/ ____| | |
" | |__) | | | | | | | __ | | | \| | (___ | |
" | ___/| | | | | | | |_ | | | | . ` |\___ \ | |
" | | | |___| |__| | |__| |_| |_| |\ |____) | | |
" |_| |______\____/ \_____|_____|_| \_|_____/ | |
call plug#begin('~/.vim/plugged') | |
" BASIC STACK | |
Plug 'scrooloose/nerdtree' | |
Plug 'unkiwii/vim-nerdtree-sync' | |
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } | |
Plug 'junegunn/fzf.vim' | |
Plug 'tpope/vim-fugitive' | |
Plug 'tpope/vim-rhubarb' | |
Plug 'neoclide/coc.nvim', { 'branch': 'release' } | |
Plug 'preservim/nerdcommenter' | |
Plug 'jiangmiao/auto-pairs' | |
Plug 'PeterRincker/vim-searchlight' | |
Plug 'vim-airline/vim-airline' | |
Plug 'rbong/vim-flog' | |
Plug 'farmergreg/vim-lastplace' | |
Plug 'vim-test/vim-test' | |
Plug 'rcarriga/vim-ultest', { 'do': ':UpdateRemotePlugins' } | |
Plug 't9md/vim-textmanip' | |
Plug 'lukas-reineke/indent-blankline.nvim' | |
" LANGUAGE SUPPORT | |
Plug 'pangloss/vim-javascript' | |
Plug 'leafgarland/typescript-vim' | |
Plug 'peitalin/vim-jsx-typescript' | |
Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' } | |
Plug 'nvim-lua/plenary.nvim' | |
Plug 'folke/todo-comments.nvim' | |
" LANGUAGE SHORTCUTS | |
Plug 'mattn/emmet-vim' | |
Plug 'SirVer/ultisnips' | |
Plug 'mlaursen/vim-react-snippets' | |
Plug 'tpope/vim-surround' | |
Plug 'evanleck/vim-svelte', { 'branch': 'main' } | |
" LINTERS | |
Plug 'maxmellon/vim-jsx-pretty' | |
Plug 'prettier/vim-prettier', { 'do': 'yarn install --frozen-lockfile --production' } | |
" EXTRAS | |
Plug 'Shougo/context_filetype.vim' | |
Plug 'glepnir/dashboard-nvim' | |
Plug 'ryanoasis/vim-devicons' | |
Plug 'editorconfig/editorconfig-vim' | |
Plug 'norcalli/nvim-colorizer.lua' | |
"plug 'lambdalisue/glyph-palette.vim' | |
" THEMES | |
Plug 'ayu-theme/ayu-vim' | |
Plug 'bignimbus/pop-punk.vim' | |
Plug 'morhetz/gruvbox' | |
Plug 'srcery-colors/srcery-vim' | |
Plug 'fcpg/vim-fahrenheit' | |
Plug 'fcpg/vim-farout' | |
call plug#end() | |
" -------------------------------------------------------------------------------------- | |
" __ __ _____ _____ _____ _ _ _____ _____ | |
" | \/ | /\ | __ \| __ \_ _| \ | |/ ____|/ ____| | |
" | \ / | / \ | |__) | |__) || | | \| | | __| (___ | |
" | |\/| | / /\ \ | ___/| ___/ | | | . ` | | |_ |\___ \ | |
" | | | |/ ____ \| | | | _| |_| |\ | |__| |____) | | |
" |_| |_/_/ \_\_| |_| |_____|_| \_|\_____|_____/ | |
" LEADER | |
let mapleader=" " | |
" GENERAL | |
nmap <silent>gd <Plug>(coc-definition) | |
nmap <silent>gr <Plug>(coc-references) | |
nmap <silent>gi <Plug>(coc-implementation) | |
nmap <silent>gy <Plug>(coc-type-definition) | |
nmap <C-C> <Plug>(coc-diagnostic-prev) | |
nmap <C-N> <Plug>(coc-diagnostic-next) | |
nmap <leader>rn <Plug>(coc-rename) | |
"nnoremap <Leader>nt :NERDTreeToggle<CR> | |
nnoremap <Leader>nt :NERDTreeFind<CR> | |
nnoremap <leader>E :tabnew ~/.vimrc<CR> | |
nmap <Leader>w :w<CR> | |
nmap <Leader>q :q<CR> | |
nmap <Leader>Q :q!<CR> | |
nnoremap <Leader><CR> :noh<CR> | |
nnoremap <C-J> <C-W><C-J> | |
nnoremap <C-K> <C-W><C-K> | |
nnoremap <C-L> <C-W><C-L> | |
nnoremap <C-H> <C-W><C-H> | |
nnoremap <Leader>i <C-W><C-R> | |
nnoremap <silent> <left> :vertical resize -5<CR> | |
nnoremap <silent> <right> :vertical resize +5<CR> | |
nnoremap <silent> <up> :resize +5<CR> | |
nnoremap <silent> <down> :resize -5<CR> | |
nnoremap <Leader>t :30split term://zsh<CR> | |
nnoremap -- <C-W>= | |
nnoremap <Leader>o o<Esc> | |
nnoremap <Leader>O O<Esc> | |
nnoremap <Leader>rr :source $MYVIMRC<CR> | |
" FZF | |
nmap <silent><C-P> :GFiles<CR> | |
nmap <silent><C-B> :Buffers<CR> | |
nmap <silent><C-F> :BLines<CR> | |
nmap <silent><C-G> :Rg<CR> | |
nmap <Leader>gh :BCommits!<CR> | |
nmap <Leader>gC :Commits!<CR> | |
nmap <silent><C-S> :GFiles!?<CR> | |
" FUGITIVE | |
nnoremap <Leader>gd :Gvdiff<CR> | |
nnoremap <Leader>gD :Gdiff<CR> | |
nnoremap <Leader>gb :Git blame<CR> | |
nnoremap <Leader>gB :GBrowse<CR> :noh<CR> | |
nnoremap <Leader>gs :Git<CR> | |
nnoremap <Leader>gl :Git log --oneline --decorate<CR> | |
nnoremap <Leader>gL :tab Git log<CR> | |
nnoremap <Leader>gc :Git commit<CR> | |
nnoremap <Leader>gcg :Git commit -n<CR> | |
nnoremap <Leader><Leader>q <C-W><C-H>:q<CR><C-O> | |
" AIRLINE | |
nmap <leader>1 <Plug>AirlineSelectTab1 | |
nmap <leader>2 <Plug>AirlineSelectTab2 | |
nmap <leader>3 <Plug>AirlineSelectTab3 | |
nmap <leader>4 <Plug>AirlineSelectTab4 | |
nmap <leader>5 <Plug>AirlineSelectTab5 | |
nmap <leader>6 <Plug>AirlineSelectTab6 | |
nmap <leader>7 <Plug>AirlineSelectTab7 | |
nmap <leader>8 <Plug>AirlineSelectTab8 | |
nmap <leader>9 <Plug>AirlineSelectTab9 | |
nmap <leader>0 <Plug>AirlineSelectTab0 | |
nmap <leader>j <Plug>AirlineSelectPrevTab | |
nmap <leader>k <Plug>AirlineSelectNextTab | |
" TEST | |
nnoremap <silent><C-T> :Ultest<CR>:UltestSummaryOpen<CR> | |
nnoremap <Leader><C-T> :UltestNearest<CR> | |
nnoremap <Leader>s :UltestSummary<CR> | |
nnoremap <Leader>ñ :TestSuite<CR> | |
" PRETTIER | |
nnoremap <Leader>p :Prettier<CR> | |
" OTHERS | |
inoremap <silent><expr> <Tab> | |
\ pumvisible() ? "\<C-n>" : | |
\ <SID>check_back_space() ? "\<Tab>" : | |
\ coc#refresh() | |
nnoremap <Leader>l :IndentBlanklineToggle<CR> | |
nnoremap <Leader>F :Flog<CR> | |
nnoremap <Leader>N :!node %<CR> | |
nnoremap <Leader>L :let @*=join([expand("%"), line(".")], ":")<CR>:noh<CR> | |
xmap <C-j> <Plug>(textmanip-move-down) | |
xmap <C-k> <Plug>(textmanip-move-up) | |
nnoremap <Leader>f :TodoQuickFix<CR> | |
" -------------------------------------------------------------------------------------- | |
" _____ ______ _______ _______ _____ _ _ _____ _____ | |
" / ____| ____|__ __|__ __|_ _| \ | |/ ____|/ ____| | |
" | (___ | |__ | | | | | | | \| | | __| (___ | |
" \___ \| __| | | | | | | | . ` | | |_ |\___ \ | |
" ____) | |____ | | | | _| |_| |\ | |__| |____) | | |
" |_____/|______| |_| |_| |_____|_| \_|\_____|_____/ | |
" FILETYPES | |
if !exists('g:context_filetype#same_filetypes') | |
let g:context_filetype#filetypes = {} | |
endif | |
let g:context_filetype#filetypes.svelte = | |
\ [ | |
\ {'filetype' : 'javascript', 'start' : '<script>', 'end' : '</script>'}, | |
\ { | |
\ 'filetype': 'typescript', | |
\ 'start': '<script\%( [^>]*\)\? \%(ts\|lang="\%(ts\|typescript\)"\)\%( [^>]*\)\?>', | |
\ 'end': '', | |
\ }, | |
\ {'filetype' : 'css', 'start' : '<style \?.*>', 'end' : '</style>'}, | |
\ ] | |
"NERDTREE | |
let NERDTreeShowHidden=1 | |
let NERDTreeQuitOnOpen=1 | |
let NERDTreeRespectWildIgnore=1 | |
let NERDTreeShowHidden=0 | |
let g:NERDTreeWinPos = "left" | |
let g:nerdtree_sync_cursorline=1 | |
let g:NERDTreeIgnore=['\~$', 'vendor', '.git', '.vscode', 'coverage'] | |
let g:NERDTreeWinSize=42 | |
let g:NERDTreeDirArrowExpandable = "❯" | |
let g:NERDTreeDirArrowCollapsible = '╍' | |
let g:NERDTreeIgnore = ['^node_modules$'] | |
" NERDTREE COMMENTER | |
let g:NERDCustomDelimiters={ | |
\ 'javascript': { 'left': '//', 'right': '', 'leftAlt': '{/*', 'rightAlt': '*/}' }, | |
\ 'html': { 'left': '<!--', 'right': '-->', 'leftAlt': '<!--', 'rightAlt': '-->' } | |
\} | |
let g:ft = '' | |
fu! NERDCommenter_before() | |
if (&ft == 'html') || (&ft == 'svelte') | |
let g:ft = &ft | |
let cfts = context_filetype#get_filetypes() | |
if len(cfts) > 0 | |
if cfts[0] == 'svelte' | |
let cft = 'html' | |
elseif cfts[0] == 'scss' | |
let cft = 'css' | |
else | |
let cft = cfts[0] | |
endif | |
exe 'setf ' . cft | |
endif | |
endif | |
endfu | |
fu! NERDCommenter_after() | |
if (g:ft == 'html') || (g:ft == 'svelte') | |
exec 'setf ' . g:ft | |
let g:ft = '' | |
endif | |
endfu | |
" FZF | |
let g:fzf_layout = { 'down': '~40%' } | |
" AIRLINE | |
" tab > shape | |
let g:airline_powerline_fonts = 1 | |
let g:airline#extensions#whitespace#enabled = 0 | |
let g:airline#extensions#tabline#enabled = 1 | |
let g:airline#extensions#tabline#show_buffers = 0 | |
let g:airline#extensions#tabline#show_tabs = 1 | |
let g:airline#extensions#tabline#formatter = "jsformatter" | |
let g:airline#extensions#tabline#buffer_idx_mode = 1 | |
let g:airline#extensions#tabline#fnamemod = ':t' | |
" LANGUAGES | |
let g:javascript_plugin_jsdoc = 1 | |
let g:javascript_plugin_flow = 1 | |
let g:typescript_indent_disable = 1 | |
let g:tsuquyomi_completion_detail = 1 | |
let g:coc_global_extensions = [ | |
\'coc-tsserver', | |
\'coc-json', | |
\'coc-html', | |
\'coc-svelte', | |
\'coc-css', | |
\'coc-sh' | |
\] | |
" DASHBOARD | |
let g:dashboard_default_executive ='fzf' | |
"let g:dashboard_custom_header = [ | |
"\ ' ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗', | |
"\ ' ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║', | |
"\ ' ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║', | |
"\ ' ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║', | |
"\ ' ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║', | |
"\ ' ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝', | |
"\ ' ', | |
"\ ' ', | |
"\ ' [@diegoulloao] ', | |
"\ ' ', | |
"\ ' ', | |
"\] | |
"let g:dashboard_custom_header=[ | |
"\'', | |
"\'███ ██ ███████ ██████ ██ ██ ██ ███ ███ ', | |
"\'████ ██ ██ ██ ██ ██ ██ ██ ████ ████ ', | |
"\'██ ██ ██ █████ ██ ██ ██ ██ ██ ██ ████ ██ ', | |
"\'██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ', | |
"\'██ ████ ███████ ██████ ████ ██ ██ ██ ', | |
"\' ', | |
"\'', | |
"\] | |
"let g:dashboard_custom_header=[ | |
"\'', | |
"\'██ ███████ ████████ ███████ ██████ ██ █████ ██ ██ ', | |
"\'██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ', | |
"\'██ █████ ██ ███████ ██████ ██ ███████ ████ ', | |
"\'██ ██ ██ ██ ██ ██ ██ ██ ██ ', | |
"\'███████ ███████ ██ ███████ ██ ███████ ██ ██ ██ ', | |
"\' ', | |
"\'', | |
"\'', | |
"\ ' [@diegoulloao] ', | |
"\'', | |
"\'', | |
"\] | |
let g:dashboard_custom_header=[ | |
\'', | |
\' ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄ ', | |
\'▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░▌ ▐░░░░░░░░░░░▌▐░▌ ▐░▌', | |
\'▐░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▐░▌', | |
\'▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌', | |
\'▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌', | |
\'▐░▌ ▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌', | |
\'▐░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░▌ ▀▀▀▀▀▀▀▀▀█░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░▌ ▐░█▀▀▀▀▀▀▀█░▌ ▀▀▀▀█░█▀▀▀▀ ', | |
\'▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ', | |
\'▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▄▄▄▄▄▄▄▄▄█░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌ ▐░▌ ', | |
\'▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌ ▐░▌ ▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░▌ ', | |
\' ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ', | |
\' ', | |
\'', | |
\'', | |
\'', | |
\'', | |
\] | |
let g:dashboard_custom_shortcut = { | |
\ 'explore_files' : 'SPC b b', | |
\ 'last_session' : 'SPC s l', | |
\ 'find_history' : 'SPC f h', | |
\ 'find_file' : 'SPC f f', | |
\ 'new_file' : 'SPC c n', | |
\ 'change_colorscheme' : 'SPC t c', | |
\ 'find_word' : 'SPC f a', | |
\ 'book_marks' : 'SPC f b', | |
\ } | |
let g:dashboard_custom_shortcut_icon = { | |
\ 'explore_files' : ' ', | |
\ 'last_session' : ' ', | |
\ 'find_history' : ' ', | |
\ 'find_file' : ' ', | |
\ 'new_file' : ' ', | |
\ 'change_colorscheme' : ' ', | |
\ 'find_word' : ' ', | |
\ 'book_marks' : ' ', | |
\ } | |
let g:dashboard_custom_section = { | |
\ 'a': { | |
\ 'description': [g:dashboard_custom_shortcut_icon['explore_files'].'Explore files '.g:dashboard_custom_shortcut['explore_files']], | |
\ 'command': 'NERDTree' | |
\ }, | |
\ 'b': { | |
\ 'description': [g:dashboard_custom_shortcut_icon['last_session'].'Open last session '.g:dashboard_custom_shortcut['last_session']], | |
\ 'command': function('dashboard#handler#last_session') | |
\ }, | |
\ 'c': { | |
\ 'description': [g:dashboard_custom_shortcut_icon['find_history'].'Recently opened files '.g:dashboard_custom_shortcut['find_history']], | |
\ 'command': function('dashboard#handler#find_history'), | |
\ }, | |
\ 'd': { | |
\ 'description': [g:dashboard_custom_shortcut_icon['find_file'].'Find file '.g:dashboard_custom_shortcut['find_file']], | |
\ 'command': function('dashboard#handler#find_file'), | |
\ }, | |
\ 'e': { | |
\ 'description': [g:dashboard_custom_shortcut_icon['new_file'].'New file '.g:dashboard_custom_shortcut['new_file']], | |
\ 'command': function('dashboard#handler#new_file'), | |
\ }, | |
\ 'f': { | |
\ 'description': [g:dashboard_custom_shortcut_icon['change_colorscheme'].'Change colorscheme '.g:dashboard_custom_shortcut['change_colorscheme']], | |
\ 'command': function('dashboard#handler#change_colorscheme'), | |
\ }, | |
\ 'g': { | |
\ 'description': [g:dashboard_custom_shortcut_icon['find_word'].'Find word '.g:dashboard_custom_shortcut['find_word']], | |
\ 'command': function('dashboard#handler#find_word'), | |
\ }, | |
\ 'h': { | |
\ 'description': [g:dashboard_custom_shortcut_icon['book_marks'].'Jump to bookmarks '.g:dashboard_custom_shortcut['book_marks']], | |
\ 'command': function('dashboard#handler#book_marks'), | |
\ } | |
\ } | |
" ULTEST | |
let g:ultest_use_pty = 1 | |
let g:ultest_pass_sign = " " | |
let g:ultest_fail_sign = " " | |
let g:ultest_running_sign = " " | |
let g:ultest_not_run_sign = " " | |
let test#javascript#jest#options = "--color=always" | |
lua <<EOF | |
-- TREESITTER | |
require("nvim-treesitter.configs").setup { | |
ensure_installed = { | |
"typescript", | |
"javascript", | |
"tsx", | |
"css", | |
"scss", | |
"svelte", | |
"markdown", | |
"yaml", | |
"bash", | |
"regex", | |
"comment" | |
}, | |
indent = { | |
enable = true | |
}, | |
highlight = { | |
enable = true, | |
-- Setting this to true will run `:h syntax` and tree-sitter at the same time. | |
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). | |
-- Using this option may slow down your editor, and you may see some duplicate highlights. | |
-- Instead of true it can also be a list of languages | |
additional_vim_regex_highlighting = false, | |
}, | |
} | |
-- TODO COMMENTS | |
require("todo-comments").setup { | |
-- config | |
} | |
EOF | |
" PRETTIER | |
let g:prettier#autoformat = 1 | |
let g:prettier#autoformat_require_pragma = 0 | |
" OTHERS | |
let g:vim_json_conceal = 0 | |
let g:user_emmet_leader_key=',' | |
let g:UltiSnipsExpandTrigger='<C-E>' | |
let g:user_emmet_settings = { | |
\ 'html' : { | |
\ 'indent_blockelement': 1, | |
\ } | |
\} | |
" -------------------------------------------------------------------------------------- | |
" ______ _ _ _ _ _____ _______ _____ ____ _ _ _____ | |
" | ____| | | | \ | |/ ____|__ __|_ _/ __ \| \ | |/ ____| | |
" | |__ | | | | \| | | | | | || | | | \| | (___ | |
" | __| | | | | . ` | | | | | || | | | . ` |\___ \ | |
" | | | |__| | |\ | |____ | | _| || |__| | |\ |____) | | |
" |_| \____/|_| \_|\_____| |_| |_____\____/|_| \_|_____/ | |
" AUTOCOMPLETION | |
function! s:check_back_space() abort " use <tab> for trigger completion and navigate to the next complete item | |
let col = col('.') - 1 | |
return !col || getline('.')[col - 1] =~ '\s' | |
endfunction | |
" FZF | |
function! Fzf_files_with_dev_icons(command) | |
let l:fzf_files_options = '--preview "bat --color always --style numbers {2..} | head -'.&lines.'"' | |
function! s:edit_devicon_prepended_file(item) | |
let l:file_path = a:item[4:-1] | |
execute 'silent e' l:file_path | |
endfunction | |
call fzf#run({ | |
\ 'source': a:command.' | devicon-lookup', | |
\ 'sink': function('s:edit_devicon_prepended_file'), | |
\ 'options': '-m ' . l:fzf_files_options, | |
\ 'down': '40%' }) | |
endfunction | |
" Colorizer | |
lua require'colorizer'.setup() | |
" -------------------------------------------------------------------------------------- | |
" _____ _______ _____ ____ _ _ _____ | |
" /\ / ____|__ __|_ _/ __ \| \ | |/ ____| | |
" / \ | | | | | || | | | \| | (___ | |
" / /\ \| | | | | || | | | . ` |\___ \ | |
" / ____ \ |____ | | _| || |__| | |\ |____) | | |
" /_/ \_\_____| |_| |_____\____/|_| \_|_____/ | |
" VIM | |
if ( has("nvim") ) | |
let $NVIM_TUI_ENABLE_TRUE_COLOR=1 | |
" Exit terminal when process is killed | |
augroup terminal_settings | |
autocmd! | |
autocmd BufWinEnter,WinEnter term://* startinsert | |
autocmd BufLeave term://* stopinsert | |
"" Ignore various filetypes as those will close terminal automatically | |
"" Ignore fzf, ranger, coc | |
autocmd TermClose term://* | |
\ if (expand('<afile>') !~ "fzf") && (expand('<afile>') !~ "ranger") && (expand('<afile>') !~ "coc") && (expand('<afile>') !~ "jest") | | |
\ call nvim_input('<CR>') | | |
\ endif | |
augroup END | |
endif | |
if !has('gui_running') | |
set t_Co=256 | |
endif | |
if exists('g:loaded_webdevicons') " After a re-source, fix syntax matching issues (concealing brackets) | |
call webdevicons#refresh() | |
endif | |
au FocusGained,BufEnter * :checktime " Fix autoload when file changes | |
" Disable indent blank line for nerdtree, dashboard | |
autocmd FileType help,nerdtree,dashboard IndentBlanklineDisable | |
" Colorized Nerd Fonts Icons | |
"augroup my-glyph-palette | |
"autocmd! * | |
"autocmd FileType fern call glyph_palette#apply() | |
"autocmd FileType nerdtree,startify call glyph_palette#apply() | |
"augroup END | |
" ------------------------------------------------------------------------------- | |
" _______ _ _ ______ __ __ ______ _____ | |
" |__ __| | | | ____| \/ | ____|/ ____| | |
" | | | |__| | |__ | \ / | |__ | (___ | |
" | | | __ | __| | |\/| | __| \___ \ | |
" | | | | | | |____| | | | |____ ____) | | |
" |_| |_| |_|______|_| |_|______|_____/ | |
set background=dark | |
if theme == "pop-punk" | |
colorscheme pop-punk | |
let g:airline_theme="pop_punk" | |
elseif theme == "gruvbox" | |
" hard|medium|soft | |
let g:gruvbox_contrast_dark="medium" | |
let g:airline_theme="gruvbox" | |
colorscheme gruvbox | |
elseif theme == "ayu" | |
" dark|mirage | |
let ayucolor="dark" | |
let g:airline_theme="ayu" | |
colorscheme ayu | |
elseif theme == "pop-punk" | |
let g:terminal_ansi_colors = pop_punk#AnsiColors() | |
let g:airline_theme="pop_punk" | |
colorscheme pop-punk | |
elseif theme == "fahrenheit" | |
let g:airline_theme="fahrenheit" | |
colorscheme fahrenheit | |
elseif theme == "farout" | |
let g:airline_theme="farout" | |
colorscheme farout | |
hi MsgArea guifg=#52332b | |
highlight IndentBlanklineIndent1 guifg=#52332b gui=nocombine | |
endif | |
" -------------------------------------------------------------------------------------- | |
" _____ ______ _______ _______ _____ _ _ _____ _____ | |
" / ____| ____|__ __|__ __|_ _| \ | |/ ____|/ ____| | |
" | (___ | |__ | | | | | | | \| | | __| (___ | |
" \___ \| __| | | | | | | | . ` | | |_ |\___ \ | |
" ____) | |____ | | | | _| |_| |\ | |__| |____) | | |
" |_____/|______| |_| |_| |_____|_| \_|\_____|_____/ | |
lua <<EOF | |
-- INDENT BLANK LINE | |
require("indent_blankline").setup { | |
char_highlight_list = { | |
"IndentBlanklineIndent1" | |
} | |
} | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awesome! thanks for sharing