File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
4444* English Dictionary completion
4545* Commands
4646 * 'ctabs' : convert tabs into 4 spaces
47- * 'rbeg ' \< NUM-CHARS\> \< REPLACE-WITH\> : Replace beginning characters of a selection
47+ * 'Rbeg ' \< NUM-CHARS\> \< REPLACE-WITH\> : Replace beginning characters of a selection
4848 * Control + b : change buffer files
4949 * Control + i : Indent all lines
5050 * Control + e : Got to the next error
Original file line number Diff line number Diff line change @@ -32,10 +32,12 @@ noremap <C-b> :bn<CR>
3232noremap <C-i> gg=G
3333
3434" "" FUNCTIONS
35- function ! ReplaceBeginningChars (numChars, replaceWith)
36- execute " :'<,'>s/^\\ .\\ {" . a: numChars . " }/" . a: replaceWith . " /"
35+ function ! ReplaceBeginningChars (numChars, newText) range
36+ let l: pattern = ' ^.\{' . a: numChars . ' }\ze'
37+ execute a: firstline . ' ,' . a: lastline . ' s/' . l: pattern . ' /' . a: newText . ' /'
3738endfunction
38- command ! -nargs =+ rbeg call ReplaceBeginningChars (<f-args> )
39+
40+ command ! -nargs =+ -range =% Rbeg :<line1> ,<line2> call ReplaceBeginningChars (<f-args> )
3941
4042" """ Ale Pluging Configuration by Victor Mours (Reference 4 in notes.md)
4143nmap <silent> <C-e> <Plug> (ale_next_wrap)
You can’t perform that action at this time.
0 commit comments