forked from jarolrod/vim-python-ide
A script shell will get a copy of the vimrc up and running on your local machine for testing purposes. The script will install the vimrc and compile the YouCompleteMe plugin:
Local user
sh -c "$(curl -fsSL https://raw.githubusercontent.com/fire3420/Dotfiles/master/setup.sh)"
curl -fsSL https://raw.githubusercontent.com/fire3420/vim-python-ide/master/setup.sh | sh
YouCompleteMe must be compiled for it to work. The install script handles the compiling, but if something goes wrong then do the following:
- Make sure the following is included in your vimrc where all the vundle plugins are placed:
Plugin 'Valloric/YouCompleteMe'
- Assuming you already have MacVim installed, install Cmake through brew
brew install cmake
- Navigate to YouCompleteMe bundle folder and run the compile script
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
- Reference the YouCompleteMe README.md for any other configuration
Make sure you have Cmake and Python 3 Headers, they can be downloaded through your distributions package manager. Then run:
cd ~/.vim/bundle/YouCompleteMe
python3 ./install.py --clang-completer
This plugin is used to show file icons in NerdTree and requires additional steps to install:
- Must install a patched font that contains required glyphs:
- Arch Linux
- Everyone Else
- Set vim encoding to UTF-8
set encoding=utf8
- Set vim font to NerdFont
set guifont=<FONT_NAME> <FONT_SIZE>
- Add glyphs to Airline
let g:airline_powerline_fonts = 1
- If you dont want this feature simply remove this plugin from your vimrc and execute :PluginUpdate in vim, for proper removal delete the devicons plugin folder
- Cherry pick the parts you like from my vimrc and add it to yours
- PEP 8 Indentation - Python Indentation
- Jinja - Syntax and Indentation
- Python Combined - Extra handling
- NerdTree - Project and File navigation
- Tagbar - Class outline
- CtrlSpace - Bookmarks/Workspaces/Fuzzy Search/ File management
- Ack - Search tool
- Airline - Tabline
- Powerline - Used for fonts
- Fixed Task List - Pending tasks
- Comfortable Motion - Physics based scrolling
- Bookmarks - Bookmark code
- Indent Guides - Visual repesentation of indents
- Snippets - Snippets
- Snip-Mate - Snippet Manager
- NerdCommenter - Easy code documentation
- Utility Functions - Add-on
- Add-on - interpret file by function
- Sparkup - Condensed HTML parser
- Riv - Take notes in RST
- Surround - Add parentheses + etc. in pairs
- Colorscheme - Change vim colorscheme
- Rainbow-Parantheses - Rianbow Parentheses
- Vim-Wiki - Personal Vim wiki
- Vimagit - Git operations from buffer
- Dev Icons - File icons in NerdTree
let g:pymode_run_bind='<F5>'
<leader>b : set breakpoint
imap <F5> <Esc>:w<CR>:!clear;python %<CR>
close :pclose or <C-w>z (vim preview window)
<leader>g : GoTO
<leader>G : GoToDefinition
<leader>T : GoToDeclaration
Action | Shortcut | Command |
---|---|---|
Add/remove bookmark at current line | mm |
:BookmarkToggle |
Add/edit/remove annotation at current line | mi |
:BookmarkAnnotate <TEXT> |
Jump to next bookmark in buffer | mn |
:BookmarkNext |
Jump to previous bookmark in buffer | mp |
:BookmarkPrev |
Show all bookmarks (toggle) | ma |
:BookmarkShowAll |
Clear bookmarks in current buffer only | mc |
:BookmarkClear |
Clear bookmarks in all buffers | mx |
:BookmarkClearAll |
Move up bookmark at current line | [count]mkk |
:BookmarkMoveUp [<COUNT>] |
Move down bookmark at current line | [count]mjj |
:BookmarkMoveDown [<COUNT>] |
Move bookmark at current line to another line | [count]mg |
:BookmarkMoveToLine <LINE> |
Save all bookmarks to a file | :BookmarkSave <FILE_PATH> |
|
Load bookmarks from a file | :BookmarkLoad <FILE_PATH> |
nmap <F9> :bprev<CR>
nmap <F10> :bnext<CR>
nnoremap <F4> :set relativenumber!<CR>
- NerdTree wil automatically open when vim is launched in terminal without a file
nmap <localleader>t :NERDTreeToggle<CR>
So ~/.tmux.conf
overrides default key bindings for many action, to make them more reasonable, easy to recall and comforable to type.
Let's go through them.
If you are an iTerm2 user, third column describes the keybinding of similar "action" in iTerm2. It's possible to reuse very same keys you already get used to and tell iTerm2 to execute analogous tmux actions. See iTerm2 and tmux integration section below.
tmux key | Description | iTerm2 key |
C-a |
Default prefix, used instead of "C-b". Same prefix is used in screen program, and it's easy to type. The only drawback of "C-a" is that underlying shell does not receive the keystroke to move to the beginning of the line. | - |
<prefix> @ |
Copy mode | - |
<prefix> C-e |
Open ~/.tmux.conf file in your $EDITOR | - |
<prefix> C-q |
Reload tmux configuration from ~/.tmux.conf file | - |
<prefix> r |
Rename current window | - |
<prefix> R |
Rename current session | - |
<prefix> _ |
Split new pane horizontally | ⌘⇧D |
<prefix> | |
Split new pane vertically | ⌘D |
<prefix> C-] |
Select next pane | |
<prefix> C-[ |
Select previous pane | |
<prefix> ← |
Select pane on the left | ⌘⌥← |
<prefix> → |
Select pane on the right | ⌘⌥→ |
<prefix> ↑ |
Select pane on the top | ⌘⌥↑ |
<prefix> ↓ |
Select pane on the bottom | ⌘⌥↓ |
<prefix> C-← |
Resize pane to the left | ^⌘← |
<prefix> C-→ |
Resize pane to the right | ^⌘→ |
<prefix> C-↑ |
Resize pane to the top | ^⌘↑ |
<prefix> C-↓ |
Resize pane to the bottom | ^⌘↓ |
<prefix> ] |
Move to next window | ⌘⇧] |
<prefix> [ |
Move to previous window | ⌘⇧[ |
<prefix> Tab |
Switch to most recently used window | ^Tab |
<prefix> L |
Link window from another session by entering target session and window reference | - |
<prefix> \ |
Swap panes back and forth with 1st pane. When in main-horizontal or main-vertical layout, the main panel is always at index 1. This keybinding let you swap secondary pane with main one, and do the opposite. | ⌘\ |
<prefix> C-o |
Swap current active pane with next one | - |
<prefix> + |
Toggle zoom for current pane | ⌘⇧Enter |
<prefix> x |
Kill current pane | ⌘W |
<prefix> X |
Kill current window | ⌘⌥W |
<prefix> C-x |
Kill other windows but current one (with confirmation) | - |
<prefix> Q |
Kill current session (with confirmation) | - |
<prefix> C-u |
Merge current session with another. Essentially, this moves all windows from current session to another one | - |
<prefix> d |
Detach from session | - |
<prefix> D |
Detach other clients except current one from session | - |
<prefix> C-s |
Save tmux env (tmux resurrect) | - |
<prefix> C-r |
Load tmux env (tmux resurrect) | - |
<prefix> m |
Monitor current window for activity | - |
<prefix> M |
Monitor current window for silence by entering silence period | - |
<prefix> F12 |
Switch off all key binding and prefix hanling in current window. See "Nested sessions" paragraph for more info | - |