How can I make Vim paste from (and copy to) the system’s clipboard?

TL;DR Try using “*yy or “+yy to copy a line to your system’s clipboard. Full answer Be aware that copying/pasting from the system clipboard will not work if :echo has(‘clipboard’) returns 0. In this case, Vim is not compiled with the +clipboard feature and you’ll have to install a different version or recompile it. Some … Read more

Delete first word of each line

:normal to the rescue: :%norm dw It basically replays the arguments as if you were typing them in normal (‘non-edit’) mode. From :help : :norm[al][!] {commands} Execute Normal mode commands {commands}. This makes it possible to execute Normal mode commands typed on the command-line. {commands} is executed like it is typed.

How to run spell check on multiple files and display any incorrect words in shell script?

You can install aspell with Homebrew on OS X. brew info aspell lists supported languages. brew install aspell –lang=en,fi,jp aspell check opens a file in an interactive spell checker: for f in *.txt; do aspell check $f; done aspell list prints all unrecognized words: cat *.txt | aspell list | sort -u Learned words are … Read more

Jump to the next word in insert mode

There’s a very useful table of insert mode motions at :h ins-special-special. <S-Left> cursor one word back (like “b” command) <C-Left> cursor one word back (like “b” command) <S-Right> cursor one word forward (like “w” command) <C-Right> cursor one word forward (like “w” command) You’ll find that Shift-Left/Right and Ctrl-Left/Right will do the trick. Ctrl/Shift … Read more

How do I install JSLint on Ubuntu? [closed]

How to install JSLint on Ubuntu: Install nodejs (includes npm, the Node Package Manager): sudo apt-get install nodejs Install node-jslint. either globally: sudo npm install -g jslint or locally, and include it in $PATH: npm install jslint and add this line to your.bashrc (adjust version number as appropriate) alias jslint=”~/.npm/jslint/0.1.8/package/bin/jslint.js”

tech