Follow me
-
Recent Posts
calendar
October 2024 M T W T F S S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Recent Comments
- Stan on python argparse issues with the help argument (TypeError: %o format: a number is required, not dict)
- Cormac on Pandas : how to compare dataframe with None
- LP on AWK: the substr command to select a substring
- jrab on python argparse issues with the help argument (TypeError: %o format: a number is required, not dict)
- How to disable SSL verification for urlretrieve? – Peter's blog on python: certificate verified failed
Archives
Categories
Meta
Tag Archives: vim
vim: multiple buffers
In order to work with several view ports of the same file in the same Vim window, type: :sp:sp You may also open another file in the same window. To do so issue the command:: :sp filename :sp filename To … Continue reading
vim: create function to remove white spaces
In the .vimrc file, add the following lines ( here ^M is a special character for the return carriage created using CTRL+V): #remove tabs function removeM() %s/^M// :endfunction function removeWhiteSpace() %s/^ \+ $// %s/^ $// %s/ \+$// %s/ $// … Continue reading
VIM : copy and paste reformats the text with lots of spaces
When I paste a piece of code or text from a copy (or the clipboard), lots of extra spaces are added at the start of each new line. The solution is to turn off the autoindent: :set paste:set paste After … Continue reading
VIM: switch all text to lower case
You can change the case of a character by typing ~ , however, if you want to change all text to the same case (let us say lower case here), then you should enter the visual mode. Go to the … Continue reading
vim usage: wrapping, spelling, completion, indentation, …
code folding To fold a number of lines (5 for example) press zf5j. To fold code within curly brackets use za The folded lines will be replaced in the buffer with a line that looks like: +—– 5 lines: }—– … Continue reading
vim: replace tabs by spaces
In the vim editor, the default behaviour of the tab key is to print a tab … not surprising. When coding, you may prefer tab to be replaced by spaces (because this is your coding style for instance). This feature … Continue reading
vim: replace the windows ^M character under Linux
Within VIM, there is a way to replace all the return carriage from Windows (that appear as ^M) by replacing them with the Linux version: % s/^M/\r/g% s/^M/\r/g When \r stands for the return carriage in Linux (not \n as … Continue reading
VIM: pasting text from GUI
In VIM, when you copy and paste text from a GUI application (e.g., firefox), VIM may insert a lot of extra white spaces by indenting the code automatically. The rendering is sometimes completely wrong, or you just do not want … Continue reading