Skip to content

Commit

Permalink
~/.vimrc added gomod and added "Return to last edit position when ope…
Browse files Browse the repository at this point in the history
…ning files"
  • Loading branch information
fb929 committed Nov 21, 2023
1 parent 11c1087 commit f4d51f6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,18 @@ augroup golang
autocmd BufNewFile,BufRead *.go let b:mtrailingws=matchadd('ErrorMsg', 's\+$', -1)
autocmd BufNewFile,BufRead *.go let b:mtrailingws=matchadd('ErrorMsg', '/\s\+$\| \+\ze\t\|^\t*\zs \+/', -1)
augroup END
augroup gomod
autocmd!
autocmd BufRead,BufNewFile *.mod match none
autocmd BufRead,BufNewFile *.mod set shiftwidth=4
autocmd BufRead,BufNewFile *.mod set tabstop=4
autocmd BufRead,BufNewFile *.mod set smarttab
autocmd BufRead,BufNewFile *.mod set noexpandtab
autocmd BufRead,BufNewFile *.mod set autoindent
autocmd BufRead,BufNewFile *.mod set smartindent
autocmd BufNewFile,BufRead *.mod let b:mtrailingws=matchadd('ErrorMsg', 's\+$', -1)
autocmd BufNewFile,BufRead *.mod let b:mtrailingws=matchadd('ErrorMsg', '/\s\+$\| \+\ze\t\|^\t*\zs \+/', -1)
augroup END

" fix term in screen
if match($TERM, "screen")!=-1
Expand Down Expand Up @@ -258,3 +270,9 @@ function OldTabs()
:match ExtraWhitespace /\s\+$\| \+\ze\t\|^\t*\zs \+/
endfunction
map <C-O> :call OldTabs()
" Return to last edit position when opening files
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif

0 comments on commit f4d51f6

Please sign in to comment.