Set vim as default cronjob editor

Method 1 vi /etc/bashrc Find export EDITOR=”pico” export VISUAL=”pico” Replace with export EDITOR=”vi” export VISUAL=”vi” Method 2 edit .bash_profile vi /root/.bash_profile Add export VISUAL=vi Once added, .bash_profile will look like root@server54 [~]# cat .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment … Read more

Install vim from source on CentOS

To install vim from source on the CentOS server, run This will install the latest version of Vim. You can start it with the command vim To get it work with “vi” command, i removed preinstalled vim editor with command Now create a symlink with

Comment multiple lines in vim

To comment multiple lines in vim, first select the line in visual mode. To change mode to visual mode, type v Now use j/k keys to select lines of text you need to comment. To comment To comment, use :norm command. :norm i# This will insert # to start of every line. When you type … Read more

vim

Vim 8 goes Visual Mode on right click vim E509: Cannot create backup file (add ! to override) Install vim from source on CentOS Using vim :set list makes all whitespace characters visible. To disable, use :set nolist :set expandtab? check if expand tab is on on or off. expandtab convert tab to space :set … Read more

Vim 8 goes Visual Mode on right click

Vim 8 shipped with Fedora 25 and Debian 9 when you mouse right click or use middle button to insert text to vim editor, it just go VISUAL mode. This is because default changes in Vim 8. Solution 1 The solution is to press SHIFT key before using mouse. SHIFT + right mouse button = … Read more