diff --git a/.vimrc b/.vimrc index 26ab99ab..e5d9ae93 100644 --- a/.vimrc +++ b/.vimrc @@ -40,6 +40,10 @@ call plug#begin('~/.vim/plugged') Plug 'lervag/vimtex', {'for': 'tex'} call plug#end() +" ============================ +" ========= settings ========= +" ============================ + filetype plugin indent on " Attempt to determine the file type of extensionless files syntax enable " Turn syntax highlighting on @@ -84,30 +88,9 @@ set smarttab " Always indent based on column number to align t set mouse=a " Enable mouse support in (a)ll modes -" Change the global leader to the space bar -let mapleader = ' ' - -" ================== Top row -nnoremap e :set nu! -nnoremap t :OverCommandLine%s/ -" ================== Middle row -nnoremap f :Files -nnoremap g :set hlsearch! -nnoremap j :Buffers -nnoremap l :Rg -" ================== Bottom row -autocmd FileType javascript nnoremap b :call JsBeautify() -autocmd FileType json nnoremap b :call JsonBeautify() -autocmd FileType jsx nnoremap b :call JsxBeautify() -autocmd FileType html nnoremap b :call HtmlBeautify() -autocmd FileType css nnoremap b :call CSSBeautify() - -" Easily enter 'zen mode' with Goyo and Pencil (Note: Goyo resets the color scheme) -nnoremap 2 :PencilSoft:Goyo:hi vertsplit ctermfg=0 ctermbg=none - -" Save and load vim sessions -nnoremap 3 :mksession! ~/.vim_session -nnoremap 4 :source ~/.vim_session +" ========================== +" ========= colors ========= +" ========================== colorscheme wal @@ -128,29 +111,12 @@ let g:lightline = { \ }, \ } -" =================================== Plugin-Specific =================================== - -let g:ale_lint_on_text_changed = 'never' " Do not lint while typing -let g:ale_lint_on_insert_leave = 1 " Only lint after leaving insert mode -let g:ale_linters = {'javascript': ['standard']} - " Don't show the separator for vertical splits -hi vertsplit ctermfg=0 ctermbg=none +highlight vertsplit ctermfg=0 ctermbg=none " Finally, an easier way to read search results -hi Search ctermbg=240 ctermfg=255 -hi IncSearch ctermbg=255 ctermfg=240 - -" Disable all vimtex keybindings so we can define our own -let g:vimtex_mappings_enabled = 0 -let g:vimtex_imaps_enabled = 0 -let g:vimtex_view_method = 'zathura' -let g:vimtex_compiler_latexmk = {'build_dir': '.tex'} -nnoremap f (vimtex-view) -nnoremap g (vimtex-compile) -nnoremap d (vimtex-env-delete) -nnoremap c (vimtex-env-change) -inoremap ]] (vimtex-delim-close) +highlight Search ctermbg=240 ctermfg=255 +highlight IncSearch ctermbg=255 ctermfg=240 " Easily show lines that go past the character count highlight OverLength ctermbg=240 ctermfg=230 @@ -159,20 +125,81 @@ call matchadd('OverLength', '\%80v') autocmd BufNewFile,BufRead *.ecr setlocal syntax=html autocmd BufNewFile,BufRead *.slang setlocal filetype=slim +" ============================ +" ========= keybinds ========= +" ============================ + +" Use space as the global leader +let mapleader = ' ' + +" Top row +nnoremap e :set nu! +nnoremap t :OverCommandLine%s/ + +" Middle row +nnoremap f :Files +nnoremap g :set hlsearch! +nnoremap j :Buffers +nnoremap l :Rg + +" Bottom row +autocmd FileType javascript nnoremap b :call JsBeautify() +autocmd FileType json nnoremap b :call JsonBeautify() +autocmd FileType jsx nnoremap b :call JsxBeautify() +autocmd FileType html nnoremap b :call HtmlBeautify() +autocmd FileType css nnoremap b :call CSSBeautify() + +" Easily enter 'zen mode' with Goyo and Pencil (Note: Goyo resets the color scheme) +nnoremap 2 :PencilSoft:Goyo:hi vertsplit ctermfg=0 ctermbg=none + +" Save and load vim sessions +nnoremap 3 :mksession! ~/.vim/.session +nnoremap 4 :source ~/.vim/.session + +" ======================= +" ========= ale ========= +" ======================= + +let g:ale_lint_on_text_changed = 'never' " Do not lint while typing +let g:ale_lint_on_insert_leave = 1 " Only lint after leaving insert mode +let g:ale_linters = {'javascript': ['standard']} + +" ========================== +" ========= vimtex ========= +" ========================== + +" Disable all keybinds so we can define our own +let g:vimtex_mappings_enabled = 0 +let g:vimtex_imaps_enabled = 0 +let g:vimtex_view_method = 'zathura' +let g:vimtex_compiler_latexmk = {'build_dir': '.tex'} + +" Set the normal keybinds +nnoremap f (vimtex-view) +nnoremap g (vimtex-compile) +nnoremap d (vimtex-env-delete) +nnoremap c (vimtex-env-change) +inoremap ]] (vimtex-delim-close) + +" ================================ +" ========= vim-markdown ========= +" ================================ + " Disable vim-markdown folding let g:vim_markdown_folding_disabled = 1 let g:vim_markdown_math = 1 let g:vim_markdown_frontmatter = 1 autocmd BufNewFile,BufRead *.md set conceallevel=2 -" Change cursor back to blink after exiting neovim -au VimLeave * set guicursor=a:block-blinkon1 - " Ignore syntax concealing for markdown files let g:vim_markdown_conceal = 0 let g:tex_conceal = "" let g:vim_markdown_math = 1 +" =========================== +" ========= fzf.vim ========= +" =========================== + " Hide the status line showing "fzf" when using fzf.vim " NOTE: You must add "showmode" if your setup depends on it autocmd! FileType fzf