Initial dotfiles configuration
This commit is contained in:
		
							
								
								
									
										87
									
								
								vim/vimrc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										87
									
								
								vim/vimrc
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,87 @@ | ||||
| set autoread | ||||
| set autowrite | ||||
| set backspace=2 | ||||
| set breakindent | ||||
| set clipboard=unnamed | ||||
| set colorcolumn=+1 | ||||
| set complete+=kspell | ||||
| set cursorline | ||||
| set diffopt+=vertical | ||||
| set encoding=utf-8 | ||||
| set expandtab | ||||
| set exrc | ||||
| set fillchars=vert:▐ | ||||
| set history=50 | ||||
| set incsearch | ||||
| set laststatus=2 | ||||
| set list listchars=tab:»·,trail:·,nbsp:· | ||||
| set modelines=0 | ||||
| set mouse=a | ||||
| set nobackup | ||||
| set nojoinspaces | ||||
| set nomodeline | ||||
| set noswapfile | ||||
| set nowritebackup | ||||
| set number | ||||
| set numberwidth=5 | ||||
| set ruler | ||||
| set shiftround | ||||
| set shiftwidth=2 | ||||
| set showbreak=·· | ||||
| set showcmd | ||||
| set signcolumn=yes | ||||
| set splitbelow | ||||
| set splitright | ||||
| set tabstop=2 | ||||
| set termencoding=utf-8 | ||||
| set termguicolors | ||||
| set textwidth=80 | ||||
| set title | ||||
| set ttyfast | ||||
| set vb t_vb= | ||||
|  | ||||
| syntax enable | ||||
| syntax sync minlines=128 maxlines=512 | ||||
|  | ||||
| let mapleader = " " | ||||
|  | ||||
| " Cursor shapes | ||||
| let &t_SI = "\<Esc>[6 q" | ||||
| let &t_SR = "\<Esc>[4 q" | ||||
| let &t_EI = "\<Esc>[0 q" | ||||
|  | ||||
| " True color support | ||||
| let &t_8f = "\<Esc>[38:2:%lu:%lu:%lum" | ||||
| let &t_8b = "\<Esc>[48:2:%lu:%lu:%lum" | ||||
|  | ||||
| " Auto-toggle paste mode | ||||
| let &t_SI .= "\<Esc>[?2004h" | ||||
| let &t_EI .= "\<Esc>[?2004l" | ||||
|  | ||||
| inoremap <special> <expr> <Esc>[200~ XTermPasteBegin() | ||||
|  | ||||
| function! XTermPasteBegin() | ||||
|   set pastetoggle=<Esc>[201~ | ||||
|   set paste | ||||
|   return "" | ||||
| endfunction | ||||
|  | ||||
| " Plugins | ||||
| call plug#begin('~/.vim/plugged') | ||||
| if filereadable(expand("~/.vimrc.plugins")) | ||||
|   source ~/.vimrc.plugins | ||||
| endif | ||||
| call plug#end() | ||||
|  | ||||
| " Lightline setup | ||||
| if filereadable(expand("~/.vimrc.lightline")) | ||||
|   source ~/.vimrc.lightline | ||||
| endif | ||||
|  | ||||
| " Color setup | ||||
| if filereadable(expand("~/.vimrc.colors")) | ||||
|   source ~/.vimrc.colors | ||||
| endif | ||||
|  | ||||
| " Set secure AFTER any other rc importing | ||||
| set secure | ||||
							
								
								
									
										33
									
								
								vim/vimrc.colors
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								vim/vimrc.colors
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,33 @@ | ||||
| function! s:sonokai_custom() abort | ||||
|   " Link a highlight group to a predefined highlight group. | ||||
|   " See `colors/sonokai.vim` for all predefined highlight groups. | ||||
|   "highlight! link groupA groupB | ||||
|   "highlight! link groupC groupD | ||||
|  | ||||
|   " Initialize the color palette. | ||||
|   " The parameter is a valid value for `g:sonokai_style`, | ||||
|   let l:palette = sonokai#get_palette('default') | ||||
|   " Define a highlight group. | ||||
|   " The first parameter is the name of a highlight group, | ||||
|   " the second parameter is the foreground color, | ||||
|   " the third parameter is the background color, | ||||
|   " the fourth parameter is for UI highlighting which is optional, | ||||
|   " and the last parameter is for `guisp` which is also optional. | ||||
|   " See `autoload/sonokai.vim` for the format of `l:palette`. | ||||
|   call sonokai#highlight('LineNr', l:palette.grey, l:palette.bg1) | ||||
|   call sonokai#highlight('SignColumn', l:palette.fg, l:palette.bg1) | ||||
|   call sonokai#highlight('VertSplit', l:palette.bg1, l:palette.none) | ||||
|   call sonokai#highlight('Terminal', l:palette.fg, l:palette.bg1) | ||||
| endfunction | ||||
|  | ||||
| augroup CustomColors | ||||
|   autocmd! | ||||
|   autocmd ColorScheme sonokai call s:sonokai_custom() | ||||
| augroup END | ||||
|  | ||||
| " Colorscheme setup | ||||
| let g:lightline.colorscheme = 'sonokai' | ||||
| let g:sonokai_transparent_background = 1 | ||||
| let g:sonokai_show_eob = 0 | ||||
|  | ||||
| colorscheme sonokai | ||||
							
								
								
									
										167
									
								
								vim/vimrc.lightline
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										167
									
								
								vim/vimrc.lightline
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,167 @@ | ||||
| " User Interface | ||||
| "{{{lightline.vim | ||||
| "{{{lightline.vim-usage | ||||
| " :h 'statusline' | ||||
| " :h g:lightline.component | ||||
| "}}} | ||||
| "{{{functions | ||||
| function! PomodoroStatus() abort"{{{ | ||||
|   if pomo#remaining_time() ==# '0' | ||||
|     return "\ue001" | ||||
|   else | ||||
|     return "\ue003 ".pomo#remaining_time() | ||||
|   endif | ||||
| endfunction"}}} | ||||
| function! CocCurrentFunction()"{{{ | ||||
|   return get(b:, 'coc_current_function', '') | ||||
| endfunction"}}} | ||||
| function! Devicons_Filetype()"{{{ | ||||
|   " return winwidth(0) > 70 ? (strlen(&filetype) ? WebDevIconsGetFileTypeSymbol() . ' ' . &filetype : 'no ft') : '' | ||||
|   return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype . ' ' . WebDevIconsGetFileTypeSymbol() : 'no ft') : '' | ||||
| endfunction"}}} | ||||
| function! Devicons_Fileformat()"{{{ | ||||
|   return winwidth(0) > 70 ? (&fileformat . ' ' . WebDevIconsGetFileFormatSymbol()) : '' | ||||
| endfunction"}}} | ||||
| function! Artify_active_tab_num(n) abort"{{{ | ||||
|   return Artify(a:n, 'bold')." \ue0bb" | ||||
| endfunction"}}} | ||||
| function! Tab_num(n) abort"{{{ | ||||
|   return a:n." \ue0bb" | ||||
| endfunction"}}} | ||||
| function! Gitbranch() abort"{{{ | ||||
|   if gitbranch#name() !=# '' | ||||
|     return gitbranch#name()." \ue725" | ||||
|   else | ||||
|     return "\ue61b" | ||||
|   endif | ||||
| endfunction"}}} | ||||
| function! Artify_inactive_tab_num(n) abort"{{{ | ||||
|   return Artify(a:n, 'double_struck')." \ue0bb" | ||||
| endfunction"}}} | ||||
| function! Artify_lightline_tab_filename(s) abort"{{{ | ||||
|   return Artify(lightline#tab#filename(a:s), 'monospace') | ||||
| endfunction"}}} | ||||
| function! Artify_lightline_mode() abort"{{{ | ||||
|   return Artify(lightline#mode(), 'monospace') | ||||
| endfunction"}}} | ||||
| function! Artify_line_percent() abort"{{{ | ||||
|   return Artify(string((100*line('.'))/line('$')), 'bold') | ||||
| endfunction"}}} | ||||
| function! Artify_line_num() abort"{{{ | ||||
|   return Artify(string(line('.')), 'bold') | ||||
| endfunction"}}} | ||||
| function! Artify_col_num() abort"{{{ | ||||
|   return Artify(string(getcurpos()[2]), 'bold') | ||||
| endfunction"}}} | ||||
| function! Artify_gitbranch() abort"{{{ | ||||
|   if gitbranch#name() !=# '' | ||||
|     return Artify(gitbranch#name(), 'monospace')." \ue725" | ||||
|   else | ||||
|     return "\ue61b" | ||||
|   endif | ||||
| endfunction"}}} | ||||
| "}}} | ||||
| set laststatus=2  " Basic | ||||
| set noshowmode  " Disable show mode info | ||||
| augroup lightlineCustom | ||||
|   autocmd! | ||||
|   autocmd BufWritePost * call lightline_gitdiff#query_git() | call lightline#update() | ||||
| augroup END | ||||
| let g:lightline = {} | ||||
| let g:lightline.separator = { 'left': "\ue0b8", 'right': "\ue0be" } | ||||
| let g:lightline.subseparator = { 'left': "\ue0b9", 'right': "\ue0b9" } | ||||
| let g:lightline.tabline_separator = { 'left': "\ue0bc", 'right': "\ue0ba" } | ||||
| let g:lightline.tabline_subseparator = { 'left': "\ue0bb", 'right': "\ue0bb" } | ||||
| let g:lightline#ale#indicator_checking = "\uf110" | ||||
| let g:lightline#ale#indicator_warnings = "\uf529" | ||||
| let g:lightline#ale#indicator_errors = "\uf00d" | ||||
| let g:lightline#ale#indicator_ok = "\uf00c" | ||||
| let g:lightline_gitdiff#indicator_added = '+' | ||||
| let g:lightline_gitdiff#indicator_deleted = '-' | ||||
| let g:lightline_gitdiff#indicator_modified = '*' | ||||
| let g:lightline_gitdiff#min_winwidth = '70' | ||||
| let g:lightline#asyncrun#indicator_none = '' | ||||
| let g:lightline#asyncrun#indicator_run = 'Running...' | ||||
| let g:lightline.active = { | ||||
|       \ 'left': [ [ 'mode', 'paste' ], | ||||
|       \           [ 'readonly', 'filename', 'modified', 'fileformat', 'devicons_filetype' ] ], | ||||
|       \ 'right': [ [ 'lineinfo' ], | ||||
|       \            [ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_ok', 'pomodoro' ], | ||||
|       \           [ 'asyncrun_status', 'coc_status' ] ] | ||||
|       \ } | ||||
| let g:lightline.inactive = { | ||||
|       \ 'left': [ [ 'filename' , 'modified', 'fileformat', 'devicons_filetype' ]], | ||||
|       \ 'right': [ [ 'lineinfo' ] ] | ||||
|       \ } | ||||
| let g:lightline.tabline = { | ||||
|       \ 'left': [ [ 'vim_logo', 'tabs' ] ], | ||||
|       \ 'right': [ [ 'gitbranch' ], | ||||
|       \ [ 'gitstatus' ] ] | ||||
|       \ } | ||||
| let g:lightline.tab = { | ||||
|       \ 'active': [ 'tabnum', 'filename', 'modified' ], | ||||
|       \ 'inactive': [ 'tabnum', 'filename', 'modified' ] } | ||||
| let g:lightline.tab_component = { | ||||
|       \ } | ||||
| let g:lightline.tab_component_function = { | ||||
|       \ 'artify_activetabnum': 'Artify_active_tab_num', | ||||
|       \ 'artify_inactivetabnum': 'Artify_inactive_tab_num', | ||||
|       \ 'artify_filename': 'Artify_lightline_tab_filename', | ||||
|       \ 'filename': 'lightline#tab#filename', | ||||
|       \ 'modified': 'lightline#tab#modified', | ||||
|       \ 'readonly': 'lightline#tab#readonly', | ||||
|       \ 'tabnum': 'Tab_num' | ||||
|       \ } | ||||
| let g:lightline.component = { | ||||
|       \ 'artify_gitbranch' : '%{Artify_gitbranch()}', | ||||
|       \ 'artify_mode': '%{Artify_lightline_mode()}', | ||||
|       \ 'artify_lineinfo': "%2{Artify_line_percent()}\uf295 %3{Artify_line_num()}:%-2{Artify_col_num()}", | ||||
|       \ 'gitstatus' : '%{lightline_gitdiff#get_status()}', | ||||
|       \ 'bufinfo': '%{bufname("%")}:%{bufnr("%")}', | ||||
|       \ 'vim_logo': "\ue7c5", | ||||
|       \ 'pomodoro': '%{PomodoroStatus()}', | ||||
|       \ 'mode': '%{lightline#mode()}', | ||||
|       \ 'absolutepath': '%F', | ||||
|       \ 'relativepath': '%f', | ||||
|       \ 'filename': '%t', | ||||
|       \ 'filesize': "%{HumanSize(line2byte('$') + len(getline('$')))}", | ||||
|       \ 'fileencoding': '%{&fenc!=#""?&fenc:&enc}', | ||||
|       \ 'fileformat': '%{&fenc!=#""?&fenc:&enc}[%{&ff}]', | ||||
|       \ 'filetype': '%{&ft!=#""?&ft:"no ft"}', | ||||
|       \ 'modified': '%M', | ||||
|       \ 'bufnum': '%n', | ||||
|       \ 'paste': '%{&paste?"PASTE":""}', | ||||
|       \ 'readonly': '%R', | ||||
|       \ 'charvalue': '%b', | ||||
|       \ 'charvaluehex': '%B', | ||||
|       \ 'percent': '%2p%%', | ||||
|       \ 'percentwin': '%P', | ||||
|       \ 'spell': '%{&spell?&spelllang:""}', | ||||
|       \ 'lineinfo': '%2p%% %3l:%-2v', | ||||
|       \ 'line': '%l', | ||||
|       \ 'column': '%c', | ||||
|       \ 'close': '%999X X ', | ||||
|       \ 'winnr': '%{winnr()}' | ||||
|       \ } | ||||
| let g:lightline.component_function = { | ||||
|       \ 'gitbranch': 'Gitbranch', | ||||
|       \ 'devicons_filetype': 'Devicons_Filetype', | ||||
|       \ 'devicons_fileformat': 'Devicons_Fileformat', | ||||
|       \ 'coc_status': 'coc#status', | ||||
|       \ 'coc_currentfunction': 'CocCurrentFunction' | ||||
|       \ } | ||||
| let g:lightline.component_expand = { | ||||
|       \ 'linter_checking': 'lightline#ale#checking', | ||||
|       \ 'linter_warnings': 'lightline#ale#warnings', | ||||
|       \ 'linter_errors': 'lightline#ale#errors', | ||||
|       \ 'linter_ok': 'lightline#ale#ok', | ||||
|       \ 'asyncrun_status': 'lightline#asyncrun#status' | ||||
|       \ } | ||||
| let g:lightline.component_type = { | ||||
|       \ 'linter_warnings': 'warning', | ||||
|       \ 'linter_errors': 'error' | ||||
|       \ } | ||||
| let g:lightline.component_visible_condition = { | ||||
|       \ 'gitstatus': 'lightline_gitdiff#get_status() !=# ""' | ||||
|       \ } | ||||
| "}}} | ||||
							
								
								
									
										15
									
								
								vim/vimrc.plugins
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								vim/vimrc.plugins
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| Plug 'tpope/vim-surround' | ||||
| Plug 'tpope/vim-fugitive' | ||||
| Plug 'neoclide/coc.nvim', {'branch': 'release'} " Git status is provided by coc-git | ||||
| Plug 'neoclide/coc-git' | ||||
| Plug 'cespare/vim-toml' | ||||
| Plug 'itchyny/lightline.vim' | ||||
| Plug 'itchyny/vim-gitbranch' | ||||
|  | ||||
| " sonokai colorscheme + supporting plugins | ||||
| Plug 'sainnhe/artify.vim' | ||||
| Plug 'macthecadillac/lightline-gitdiff' | ||||
| Plug 'albertomontesg/lightline-asyncrun' | ||||
| Plug 'rmolin88/pomodoro.vim' | ||||
| Plug 'ryanoasis/vim-devicons' | ||||
| Plug 'sainnhe/sonokai' | ||||
		Reference in New Issue
	
	Block a user