convert to vim9
This commit is contained in:
135
vim/.config/vim/vimrc
Normal file
135
vim/.config/vim/vimrc
Normal file
@@ -0,0 +1,135 @@
|
||||
syntax on
|
||||
set smarttab ts=2 sw=2
|
||||
set softtabstop=2
|
||||
set expandtab
|
||||
set autoindent
|
||||
|
||||
set backspace=indent,eol,start
|
||||
|
||||
set background=dark
|
||||
colorscheme theunixzoo
|
||||
"colorscheme plain-cterm
|
||||
"colorscheme aomi-grayscale
|
||||
"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
|
||||
au FileType markdown 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>
|
||||
nmap <leader>toc :put =system('gh-md-toc --hide-header --hide-footer', getline('.', '$'))<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 wildmode=longest:full,full
|
||||
set wildignore=*.pyc,*.swp,.git/**
|
||||
|
||||
set showmatch " highlights matching parens
|
||||
|
||||
set cursorline " highlights the current line
|
||||
|
||||
" Search down into subfolders
|
||||
set path+=**
|
||||
|
||||
|
||||
" netrw config
|
||||
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=',\(^\|\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 shortcuts
|
||||
nnoremap <c-p> <cmd>Files<CR>
|
||||
nnoremap <c-\> <cmd>Buffers<CR>
|
||||
nnoremap <c-g> <cmd>Rg<CR>
|
||||
|
||||
"
|
||||
" Github Copilot
|
||||
"
|
||||
" disable Copilot ny default
|
||||
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