Skip to content

fire3420/Dotfiles

Repository files navigation

My personal dotfiles

forked from jarolrod/vim-python-ide

Table of contents

Getting Started

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:

Bash

Local user
sh -c "$(curl -fsSL https://raw.githubusercontent.com/fire3420/Dotfiles/master/setup.sh)"

Fish

curl -fsSL https://raw.githubusercontent.com/fire3420/vim-python-ide/master/setup.sh | sh       

YouCompleteMe

YouCompleteMe must be compiled for it to work. The install script handles the compiling, but if something goes wrong then do the following:

  1. Make sure the following is included in your vimrc where all the vundle plugins are placed:
Plugin 'Valloric/YouCompleteMe'

MacOS

  1. Assuming you already have MacVim installed, install Cmake through brew
brew install cmake
  1. Navigate to YouCompleteMe bundle folder and run the compile script
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
  1. Reference the YouCompleteMe README.md for any other configuration

Linux

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

DevIcons (Optional)

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

Alternatively:

  • Cherry pick the parts you like from my vimrc and add it to yours

Plugins

Code and Project Navigation

Snippets

Extra

Key-Bindings

Python

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)

Youcompleteme

<leader>g : GoTO
<leader>G : GoToDefinition
<leader>T : GoToDeclaration

Bookmark

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>

Switching Between Buffers

nmap <F9> :bprev<CR>
nmap <F10> :bnext<CR>

Toggle Relative Numbering

nnoremap <F4> :set relativenumber!<CR>

NerdTree Toggle

  • NerdTree wil automatically open when vim is launched in terminal without a file
nmap <localleader>t :NERDTreeToggle<CR>

Tmux Key bindings

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 -

Tmux conf

Tmux plugins

Vim cheatsheet

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published