Skip to content

Instantly share code, notes, and snippets.

@igorparrabastias
Last active November 17, 2015 13:00
Show Gist options
  • Save igorparrabastias/4062dd2a4d7610ab0cf1 to your computer and use it in GitHub Desktop.
Save igorparrabastias/4062dd2a4d7610ab0cf1 to your computer and use it in GitHub Desktop.
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment