User Tools

Site Tools


vim_notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
vim_notes [2021/07/02 18:55] – [show line endings] adminvim_notes [2023/07/27 21:10] – [join lines with a character] raju
Line 1: Line 1:
 ===== How can I ===== ===== How can I =====
 ==== vertical alignment of columns ==== ==== vertical alignment of columns ====
-<code> +  * [[pretty_print_csv_data#vim | pretty print csv data in vim]]
-:%!column -t +
-</code> +
- +
-will convert +
-<code> +
-1.33570301776, 3.61194e-06, 7.24503e-06, -9.91572e-06, 1.25098e-05, 0.0102828 +
-1.34538754675, 3.3689e-06, 9.86066e-06, -9.12075e-06, 1.18058e-05, 0.00334344 +
-1.34808186291, -1.99011e-06, 6.53026e-06, -1.18909e-05, 9.52337e-06, 0.00158065 +
-</code> +
- +
-to +
-<code> +
-1.33570301776,  3.61194e-06,   7.24503e-06,  -9.91572e-06,  1.25098e-05,  0.0102828 +
-1.34538754675,  3.3689e-06,    9.86066e-06,  -9.12075e-06,  1.18058e-05,  0.00334344 +
-1.34808186291,  -1.99011e-06,  6.53026e-06,  -1.18909e-05,  9.52337e-06,  0.00158065 +
-</code> +
- +
-It also works on visual selection +
-<code> +
-:'<,'>!column -t +
-</code> +
- +
 ==== show line endings ==== ==== show line endings ====
   * https://stackoverflow.com/questions/3569997/how-to-find-out-line-endings-in-a-text-file -> https://stackoverflow.com/a/3570051   * https://stackoverflow.com/questions/3569997/how-to-find-out-line-endings-in-a-text-file -> https://stackoverflow.com/a/3570051
Line 45: Line 22:
   * https://vi.stackexchange.com/a/14248/12620   * https://vi.stackexchange.com/a/14248/12620
  
 +==== print full file name ====
 +
 +  * :echo expand("%:p")
 +  * :!ls %:p
 +  * :!realpath % - be aware that realpath is not POSIX
 +  * :!echo "$PWD/%" - very difficult to type this!
 +  * 1 followed by ctrl-g - shows full path name but does not expand "~" to home directory
 +  * :'<,'>!realpath % - to replace the current selection with the file path
 +  * set statusline+=%F - will show full filename in the status bar
 +  * ctrl-g - shows file path relative to vim's current working directory
 +
 +Ref:- http://vi.stackexchange.com/questions/104/how-can-i-see-the-full-path-of-the-current-file
vim_notes.txt · Last modified: 2023/08/02 18:18 by raju