NomikOS
11/13/2015 - 9:30 PM

Linux/Bash Commands

Linux/Bash Commands

# Display the path of the current file at bottom in Vim
# .vimrc
set laststatus=2
set statusline+=#F

# Install full version of Vim in Ubuntu
sudo apt-get remove vim-tiny
sudo apt-get install vim

# Color command line with git branch
# .bashrc
source ~/.bash_git
PS1='\n\[\e[1;37m\]|-- \[\e[1;32m\]\u\[\e[0;39m\]@\[\e[1;36m\]\h\[\e[0;39m\]:\[\e[1;33m\]\w\[\e[0;39m\]\[\e[1;35m\]$(__git_ps1 " (%s)")\[\e[0;39m\] \[\e[1;37m\]--|\[\e[0;39m\]\n$ '

# Get colors in 'less'' command
Use view instead of less. It opens the file with vim in readonly mode.
It's practically a coloured less: a pager where you can search with / (and more). The only drawback is that you can't exit with q but you need :q
Also, you get the same colouring as vim (since you're in fact using vim).