use vim
This commit is contained in:
89
vim/.vimrc
89
vim/.vimrc
@@ -6,24 +6,52 @@ set autoindent
|
||||
|
||||
set backspace=indent,eol,start
|
||||
|
||||
set t_Co=16
|
||||
set background=dark
|
||||
colorscheme theunixzoo
|
||||
"colorscheme solarized8
|
||||
|
||||
"source /home/jswank/.config/nvim/colors-now
|
||||
|
||||
"set gfn=Droid\ Sans\ Mono\ 10
|
||||
set gfn=Inconsolata\ 12
|
||||
set guioptions-=T
|
||||
|
||||
"use semicolon as colon for commands
|
||||
nmap ; :
|
||||
|
||||
"disable mouse support (nvim)
|
||||
set mouse=
|
||||
|
||||
filetype plugin on
|
||||
filetype indent on
|
||||
set ofu=syntaxcomplete#Complete#
|
||||
|
||||
au FileType python setlocal tabstop=4 expandtab shiftwidth=4 softtabstop=4
|
||||
|
||||
" enable snippets
|
||||
" let g:UltiSnipsExpandTrigger="<tab>"
|
||||
" list all snippets
|
||||
" let g:UltiSnipsListSnippets="<c-l>"
|
||||
|
||||
" typing idate inserts the current date
|
||||
iab idate <c-r>=strftime("%Y-%m-%d")<cr>
|
||||
|
||||
" use \ toc to insert a table of contents for markdown from the current line to EOF
|
||||
nmap <leader>toc <cmd>.put =execute('.,$write !gh-md-toc --hide-header --hide-footer')<cr>
|
||||
|
||||
" use \ tf to format a buffer as tofu / terraform
|
||||
nmap <leader>tf <cmd>% !tofu fmt -no-color -<cr>
|
||||
|
||||
" use \ jn to format a buffer as Jsonnet
|
||||
nmap <leader>jn <cmd>% !jsonnetfmt -<cr>
|
||||
|
||||
" use \ js to format a buffer as JSON
|
||||
nmap <leader>js <cmd>% !jq . -<cr>
|
||||
|
||||
set lazyredraw " redraw only when req'd
|
||||
set wildmenu " visual auto-complete
|
||||
set showmatch
|
||||
"set cursorline
|
||||
set cursorline
|
||||
|
||||
" Search down into subfolders
|
||||
" Provides tab-completion for all file-related tasks
|
||||
@@ -34,12 +62,65 @@ let g:netrw_banner=0 " disable annoying banner
|
||||
let g:netrw_browse_split=0 " open in prior window
|
||||
let g:netrw_altv=1 " open splits to the right
|
||||
let g:netrw_liststyle=3 " tree view
|
||||
let g:netrw_list_hide=netrw_gitignore#Hide()
|
||||
let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+'
|
||||
" let g:netrw_list_hide=',\(^\|\s\s\)\zs\.\S\+'
|
||||
|
||||
" NOW WE CAN:
|
||||
" - :edit a folder to open a file browser
|
||||
" - <CR>/v/t to open in an h-split/v-split/tab
|
||||
" - check |netrw-browse-maps| for more mappings
|
||||
|
||||
" fzf-lua
|
||||
nnoremap <c-p> <cmd>Files<CR>
|
||||
nnoremap <c-\> <cmd>Buffers<CR>
|
||||
nnoremap <c-g> <cmd>Rg<CR>
|
||||
|
||||
"
|
||||
" Github Copilot
|
||||
"
|
||||
" disable Copilot for now
|
||||
let g:copilot_enabled = 0
|
||||
" map key to enable copilot
|
||||
nmap <leader>cp :let g:copilot_enabled = 1<CR>
|
||||
|
||||
" format any yaml file
|
||||
" autocmd BufWritePre *.yaml :%!yq -i %
|
||||
|
||||
"
|
||||
" GO stuff
|
||||
"
|
||||
" format with goimports instead of gofmt
|
||||
let g:go_fmt_command = "goimports"
|
||||
|
||||
" more syntax highlighting
|
||||
let g:go_highlight_functions = 1
|
||||
let g:go_highlight_methods = 1
|
||||
let g:go_highlight_structs = 1
|
||||
let g:go_highlight_interfaces = 1
|
||||
let g:go_highlight_operators = 1
|
||||
let g:go_highlight_build_constraints = 1
|
||||
|
||||
" disable folding for markdown
|
||||
let g:vim_markdown_folding_disabled = 1
|
||||
|
||||
"let g:hcl_fmt_autosave = 1
|
||||
"let g:tf_fmt_autosave = 1
|
||||
"let g:nomad_fmt_autosave = 1
|
||||
|
||||
" ancient stuff
|
||||
"
|
||||
"autocmd BufRead,BufNewFile *.go set makeprg=go\ build
|
||||
"map <leader>gr <ESC>:!gorun %<CR>
|
||||
|
||||
"for javascript:
|
||||
"use google closure to generate errors
|
||||
":set makeprg=closure\ --js\ %
|
||||
"javac style errors
|
||||
":setl efm=%A%f:%l:\ %m,%+Z%p^,%+C%.%#,%-G%.%#
|
||||
|
||||
"autocmd BufRead,BufNewFile *.js :call My_JS()
|
||||
"function! My_JS()
|
||||
" set makeprg=closure\ --js\ %
|
||||
" setl efm=%A%f:%l:\ %m,%+Z%p^,%+C%.%#,%-G%.%#
|
||||
"endfunction
|
||||
|
||||
"map <leader>hh :!tidy -q -i --show-errors 0<CR>
|
||||
|
||||
Reference in New Issue
Block a user