Highlighted text search, use bufread instead of filetype

This commit is contained in:
Daniel Lynn 2021-07-14 16:45:41 -05:00
parent de109371fd
commit eab0c33534
Signed by: daniel
GPG Key ID: 28496A140E180A9D
2 changed files with 13 additions and 4 deletions

View File

@ -16,8 +16,16 @@ noremap <Leader><Esc> :let @/ = ""<CR>
" Spellcheck
nnoremap <Leader>S :setlocal spell! spelllang=en_us<CR>
" Easy motion to start/end of a line
noremap H ^
noremap L $
" Toggle cursorline and relativelinenumber quickly
noremap <Leader>c :set cursorline!<CR>
noremap <Leader>n :set relativenumber!<CR>
" Oops, forgot a semi-colon...
noremap <Leader>; $a;<Esc>
" Search highlighted text in buffer
vnoremap // y/\V<C-R>=escape(@",'/\')<CR><CR>

View File

@ -7,11 +7,12 @@ let g:vim_markdown_strikethrough = 1
let g:vim_markdown_autowrite = 1
let g:vim_markdown_edit_url_in = 'tab'
let g:vim_markdown_follow_anchor = 1
let g:goyo_linenr = 1
augroup CustomMarkdown
autocmd BufNewFile,BufRead *.md set filetype=markdown
autocmd FileType markdown Goyo
autocmd FileType markdown setlocal linebreak
autocmd FileType markdown setlocal nocursorline
autocmd FileType markdown setlocal nocursorcolumn
autocmd BufNewFile,BufRead *.md Goyo
autocmd BufNewFile,BufRead *.md setlocal linebreak
autocmd BufNewFile,BufRead *.md setlocal nocursorline
autocmd BufNewFile,BufRead *.md setlocal nocursorcolumn
augroup END