Skip to content

Commit

Permalink
Handle line width better
Browse files Browse the repository at this point in the history
* Highlight character over line width
* Automatically wrap comments
  • Loading branch information
MarcelRobitaille committed Jul 8, 2018
1 parent 25e6591 commit 498d8ef
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions vim/.vim/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,21 @@ Plug 'statico/vim-javascript-sql'

call plug#end()


"
" Macros
"

" Macro to switch common.js to es6 imports
let @i = "^cwimportf=dwcwfrom lds("

" Macro to fix typos in line
let @s = "$[s1z="
let g:doxygen_enhanced_color = 1

" Convert class method to arrow function
let @a = "^f(i = f{i=> "


"
" General settings
"
Expand Down Expand Up @@ -187,6 +192,13 @@ match Todo /\s\+$/
" No folding
set nofoldenable

" Highlight characters that go over line length limit
augroup vimrc_autocmds
autocmd BufEnter * highlight OverLength ctermbg=grey
autocmd BufEnter * match OverLength /\%80v.*/
augroup END


"
" Navigation
"
Expand Down Expand Up @@ -247,7 +259,7 @@ set hidden

" Go to nth buffer
let c = 1
while c <= 99
while c <= 999
execute "nnoremap " . c . "<leader> :" . c . "b\<CR>"
let c += 1
endwhile
Expand Down Expand Up @@ -278,6 +290,10 @@ nnoremap <leader>dd 0D
nnoremap s :<C-U>exec "normal i".RepeatChar(nr2char(getchar()), v:count1)<CR>
nnoremap S :<C-U>exec "normal a".RepeatChar(nr2char(getchar()), v:count1)<CR>
" Continue comments on next line when max length is reached
set textwidth=80
set formatoptions+=c


"
" Spelling
Expand Down

0 comments on commit 498d8ef

Please sign in to comment.