Hi! So, this is my set of config files (for Vim, Tmux, Bash, and Git) for when I need to be using a new computer or when I want people to try vim because I love vim (wow, did you know?).
Feel free to use any/all of these, or parts of them as needed. It might be useful to just take the parts you need, and add whatever I'm missing. I got a handful of stuff for vim/tmux from when I worked at Braintree here (thanks Braintree).
On that note, you can find more useful plugins here: Vim Awesome.
This is what my vim/tmux/bash looks like:
Honestly, I've changed this so much over the years that I can't really remember what it is that I added anymore... but here's a list of the stuff I do remember:
- Allows wrapping around to next line
- Mouse mode (scrolling, clicking)
- Line numbers
- Language specific tabs/spaces
- Color scheme: Monokai. You can change this line in the
.vimrc
:colorscheme [color scheme name]
to update it. - F7 for autoformat C/C++ code
- I used the Vundle plugin manager, just because it was easy to use... there's a few different ones you can use instead if you want.
- This lets you include new plugins by just writing
Plugin [github username/repo name]
in your vimrc. - install with
:PluginInstall
. - uninstall by deleting and running
:PluginClean
.
\nt - open/close NERD Tree
\nf - reveal current file in NERD Tree
\nr - refresh contents of NERD Tree (can also use r or R to refresh a folder)
? - in NERD Tree to see all shortcuts
This is so much better than using the file explorer when you need to search through a ton of files.
\ff - find a file
gcc - toggle comments on the current line
\cc - toggle comments
Fugitive - Git wrapper
:Gstatus - git status
:Gblame - git blame
...amongst a bunch of other things
- Auto closes parens, quotes etc
- Customizable tab bar thingy
- You can comment out line 40
Plugin ryanoasis/vim-devicons
if you don't want to deal with installing the font for the icons. They're cute though. But unnecessary.
-
Here's a handy tmux cheatsheet. I'm just listing the things I changed:
-
I changed the prefix to
Ctrl + a
instead of the defaultCtrl + b
because... a is closer than b.prefix
will stand forCtrl + a
-
Mouse mode is on, so you can drag panes with mouse, or click to a different window
prefix
+ | - split pane vertically
prefix
+ v - split pane vertically
prefix
+ - - split pane horizontally
prefix
+ s - split pane horizontally
Alt/Option + [arrow key] - switch panes without needing prefix
prefix
+ r - reload tmux config file
Tmux Plugin Manager (TPM):
- I used TPM: as the plugin manager:
- Add new plugin to
~/.tmux.conf
withset -g @plugin [pluginname]
- Install plugins with prefix + I (capital i).
- Uninstall by removing plugin from
~/.tmux.conf
and pressing prefix + alt/option + u
- The theme I use works well with a dark background, you should probably change it/uninstall this plugin if you have a light background.
- Includes what git branch you are in if you're in a git repo
- Includes some git aliases
If you decide to use this :')
Clone repo!
git clone https://github.com/qarni/dotfiles.git [destination]
And copy over whichever of these files you want to your root directory.
- Install Vundle by running:
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
- Install Monokai color scheme:
# create directory for vim colors if it does not already exist
mkdir -p ~/.vim/colors
And then download the colors/monokai.vim file from the repo to ~/.vim/colors
.
- Follow directions here to install Nerd font. You might need to change things depending on what terminal you use? I use iterm2.
- Follow directions here to install YouCompleteMe at your own risk, or just leave it commented out.
- Open your vimrc file in vim:
vim ~/.vimrc
. - Run the command:
:PluginInstall
. - Yay everything should be good to go for vim!
- Make sure you have tmux installed. You can run the command
tmux
to check. If it's not installed... install it. :) - Clone Tmux Plugin Manager:
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
- Open a tmux session:
tmux
- Run this command to load your tmux config file:
tmux source-file ~/.tmux.conf
. - Press prefix + I (capital i) to fetch the plugin.
- Yay tmux works too!