Feb 7, 2020
#vim
#windows
In vim, to remove the ^M character you could do:
:e ++ff=dos The :e ++ff=dos command tells Vim to read the file again, forcing dos file format. Vim will remove CRLF and LF-only line endings, leaving only the text of each line in the buffer.
Then set filetype to unix:
:set ff=unix And save the file:
:x
…
Sep 28, 2016
#vim
#xterm
When trying to open vi/vim the following message could appear:
"E437: terminal capability "cm" required" To fix it type:
$ export TERM=xterm
…
Aug 8, 2016
#vim
#tips
Quote/unquote words: ciw'Ctrl+r"' or
ciw '' Esc p p paste after the cursor, P will paste before the cursor.
Search matches (gn with the dot command) Suppose that we have a document containing several occurrences of the word ‘Normal’ and we’d like to change each occurrence to ‘Visual’. We can run /Normal to search for the word ‘Normal’, then type cgnVisual<Esc> to change the next match to the word ‘Visual’ and by pressing .
…
Jul 30, 2016
#git
#mac
#zsh
#vim
Homebrew installs the stuff you need that Apple didn’t.
For example to update python and avoid many SSL warnings:
brew install python To use an updated version of git on mac use:
brew install git --whitout-completion To update vim:
brew install vim --with-override-system-vi Updating zsh:
# check the zsh info brew info zsh # install zsh brew install zsh # add shell path sudo vim /etc/shells # add the following line into the very end of the file(/etc/shells) /usr/local/bin/zsh # change default shell chsh -s /usr/local/bin/zsh Install some extra packages in oneline:
…