misc vim and fish

This commit is contained in:
Noah Masur
2020-07-31 20:44:02 -04:00
parent 25f9c023f8
commit b09c6c6f90
7 changed files with 94 additions and 6 deletions

View File

@ -10,7 +10,13 @@ Plug 'Raimondi/delimitMate' " Auto-close parentheses
Plug 'tpope/vim-commentary' " Use gc or gcc to comment
Plug 'hashivim/vim-terraform' " Terraform HCL syntax
Plug 'vimwiki/vimwiki' " Wiki System
Plug 'jreybert/vimagit' " Git GUI
Plug 'jreybert/vimagit' " Git 'gui' buffer
Plug 'airblade/vim-gitgutter' " Git next to line numbers
Plug 'tpope/vim-fugitive' " Other git commands
Plug 'machakann/vim-highlightedyank' " Highlight text when copied
Plug 'itchyny/lightline.vim' " Status bar
Plug 'shinchu/lightline-gruvbox.vim' " Colors for status bar
Plug 'tpope/vim-vinegar' " Fixes netrw file explorer
call plug#end()
@ -29,7 +35,6 @@ set softtabstop=4 " Amount to shift with TAB key
set ignorecase " Ignore case when searching
set smartcase " Check case when using capitals in search
set incsearch " Search while typing
set pastetoggle=<F3>
set visualbell " No sounds
set scrolljump=1 " Scroll more than one line (or 1 line)
set scrolloff=3 " Margin of lines when scrolling
@ -66,7 +71,7 @@ endif
map <Space> <Leader>
" Jump to text in this directory
nnoremap <Leader>t :Rg<CR>
nnoremap <Leader>/ :Rg<CR>
" Open file in this directory
nnoremap <Leader>f :Files<cr>
@ -77,6 +82,21 @@ nnoremap <Leader>b :Buffers<cr>
" Jump to text in this file
nnoremap <Leader>s :BLines<cr>
" Start Magit buffer
nnoremap <Leader>g :Magit<cr>
" Toggle Git gutter (by line numbers)
nnoremap <Leader>` :GitGutterToggle<cr>
" Git push
nnoremap <Leader>p :Git push<cr>
" Close all other splits
nnoremap <Leader>m :only<cr>
" Open file tree
nnoremap <Leader>t :Vexplore<cr>
" Mouse interaction / scrolling
set mouse=nv
@ -84,6 +104,21 @@ set mouse=nv
let &titlestring = @%
set title
" Make whitespace pretty
" if &listchars ==# 'eol:$'
" set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
" endif
" Built-in explorer plugin
let g:netrw_liststyle = 3 " Change style to 'tree' view
let g:netrw_banner = 0 " Remove useless banner
let g:netrw_winsize = 15 " Explore window takes % of page
let g:netrw_browse_split = 4 " Open in previous window
let g:netrw_altv = 1 " idk
" Gitgutter plugin
let g:gitgutter_enabled = 0 " Disable on start
" Terraform Plugin
let g:terraform_fmt_on_save=1
@ -91,3 +126,22 @@ let g:terraform_fmt_on_save=1
let g:vimwiki_list = [{'path': '~/Documents/notes/',
\ 'syntax': 'markdown', 'ext': '.md'}]
function! GitStatus()
let [a,m,r] = GitGutterGetHunkSummary()
return printf('+%d ~%d -%d', a, m, r)
endfunction
let g:lightline = {
\ 'colorscheme': 'jellybeans',
\ 'active': {
\ 'right': [[ 'lineinfo' ]],
\ 'left': [[ 'mode', 'paste' ],
\ [ 'readonly', 'relativepath', 'gitbranch', 'modified' ]]
\ },
\ 'component_function': {
\ 'gitbranch': 'fugitive#head'
\ }
\ }
" let g:lightline.colorscheme = 'gruvbox'
" set statusline+=%{GitStatus()}