├── .gitignore ├── LICENSE.rst ├── README.md ├── setup.sh └── vimrc /.gitignore: -------------------------------------------------------------------------------- 1 | *.bak 2 | bundle/ 3 | colors/ 4 | -------------------------------------------------------------------------------- /LICENSE.rst: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, ETS Labs 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of "VIMRC" nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Imgur](https://i.imgur.com/hVVulbM.png) 2 | 3 | ![screenshot](https://i.imgur.com/KoKH5aA.png) 4 | 5 | 6 | 7 | Table of contents 8 | ================= 9 | * [Getting Started](#getting-started) 10 | * [Bash](#bash) 11 | * [Fish](#fish) 12 | * [DevIcons](#devicons-optional) 13 | * [Manual Install](#alternatively) 14 | * [Plugins](#plugins) 15 | * [Python](#python) 16 | * [Code + Project Navigation](#code-and-project-navigation) 17 | * [Snippets](#snippets) 18 | * [Extra](#extra) 19 | * [Key Bindings](#key-bindings) 20 | * [Python](#python) 21 | * [Switching Between Buffers](#switching-between-buffers) 22 | * [Toggle Relative Numbering](#toggle-relative-numbering) 23 | * [Comfortable Motion Scrolling](#comfortable-motion-scrolling) 24 | * [NerdTree Toggle](#nerdtree-toggle) 25 | * [Disable Arrow Keys](#disable-arrow-keys) 26 | 27 | ## Getting Started 28 | 29 | 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: 30 | ### Bash 31 | ``` 32 | sh -c "$(curl -fsSL https://raw.githubusercontent.com/jarolrod/vim-python-ide/master/setup.sh)" 33 | ``` 34 | ### Fish 35 | ``` 36 | curl -fsSL https://raw.githubusercontent.com/jarolrod/vim-python-ide/master/setup.sh | sh 37 | ``` 38 | ### YouCompleteMe 39 | YouCompleteMe must be compiled for it to work. The install script handles the compiling, but if something goes wrong then do the following: 40 | 41 | 1. Make sure the following is included in your vimrc where all the vundle plugins are placed: 42 | ``` 43 | Plugin 'Valloric/YouCompleteMe' 44 | ``` 45 | 46 | #### MacOS 47 | 1. Assuming you already have MacVim installed, install Cmake through brew 48 | ``` 49 | brew install cmake 50 | ``` 51 | 2. Navigate to YouCompleteMe bundle folder and run the compile script 52 | ``` 53 | cd ~/.vim/bundle/YouCompleteMe 54 | ./install.py --clang-completer 55 | ``` 56 | 3. Reference the [YouCompleteMe](https://github.com/ycm-core/YouCompleteMe) README.md for any other configuration 57 | 58 | ### Linux 59 | Make sure you have Cmake and Python 3 Headers, they can be downloaded through your distributions package manager. Then run: 60 | ``` 61 | cd ~/.vim/bundle/YouCompleteMe 62 | python3 ./install.py --clang-completer 63 | ``` 64 | 65 | ### DevIcons (Optional) 66 | This plugin is used to show file icons in NerdTree and requires additional steps to install: 67 | * Must install a patched font that contains required glyphs: 68 | * [Arch Linux](https://aur.archlinux.org/packages/nerd-fonts-complete/) 69 | * [Everyone Else](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts) 70 | * Set vim encoding to UTF-8 71 | ``` 72 | set encoding=utf8 73 | ``` 74 | * Set vim font to NerdFont 75 | ``` 76 | set guifont= 77 | ``` 78 | * Add glyphs to Airline 79 | ``` 80 | let g:airline_powerline_fonts = 1 81 | * 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 82 | 83 | ### Alternatively: 84 | * Cherry pick the parts you like from my vimrc and add it to yours 85 | 86 | ## Plugins 87 | * [PEP 8 Indentation](https://github.com/Vimjas/vim-python-pep8-indent) - Python Indentation 88 | * [Jinja](https://github.com/lepture/vim-jinja) - Syntax and Indentation 89 | * [Python Combined](https://github.com/mitsuhiko/vim-python-combined) - Extra handling 90 | 91 | 92 | ### Code and Project Navigation 93 | * [NerdTree](https://github.com/scrooloose/nerdtree) - Project and File navigation 94 | * [Tagbar](https://github.com/majutsushi/tagbar) - Class outline 95 | * [CtrlSpace](https://github.com/vim-ctrlspace/vim-ctrlspace) - Bookmarks/Workspaces/Fuzzy Search/ File management 96 | * [Ack](https://github.com/mileszs/ack.vim) - Search tool 97 | * [Airline](https://github.com/vim-airline/vim-airline) - Tabline 98 | * [Powerline](https://github.com/powerline/powerline) - Used for fonts 99 | * [Fixed Task List](https://github.com/fisadev/FixedTaskList.vim) - Pending tasks 100 | * [Comfortable Motion](https://github.com/yuttie/comfortable-motion.vim) - Physics based scrolling 101 | * [Bookmarks](https://github.com/MattesGroeger/vim-bookmarks) - Bookmark code 102 | * [Indent Guides](https://github.com/nathanaelkane/vim-indent-guides) - Visual repesentation of indents 103 | 104 | ### Snippets 105 | * [Snippets](https://github.com/honza/vim-snippets) - Snippets 106 | * [Snip-Mate](https://github.com/garbas/vim-snipmate) - Snippet Manager 107 | * [NerdCommenter](https://github.com/scrooloose/nerdcommenter) - Easy code documentation 108 | * [Utility Functions](https://github.com/tomtom/tlib_vim) - Add-on 109 | * [Add-on](https://github.com/MarcWeber/vim-addon-mw-utils) - interpret file by function 110 | 111 | ### Extra 112 | * [Sparkup](https://github.com/rstacruz/sparkup) - Condensed HTML parser 113 | * [Riv](https://github.com/Rykka/riv.vim) - Take notes in RST 114 | * [Surround](https://github.com/tpope/vim-surround) - Add parentheses + etc. in pairs 115 | * [Colorscheme](https://github.com/flazz/vim-colorschemes) - Change vim colorscheme 116 | * [Rainbow-Parantheses](https://github.com/kien/rainbow_parentheses.vim) - Rianbow Parentheses 117 | * [Vim-Wiki](https://github.com/vimwiki/vimwiki) - Personal Vim wiki 118 | * [Vimagit](https://github.com/jreybert/vimagit) - Git operations from buffer 119 | * [Dev Icons](https://github.com/ryanoasis/vim-devicons) - File icons in NerdTree 120 | * [DevIcons Installation](#devicons-optional) 121 | 122 | ## Key-Bindings 123 | ### Python 124 | ``` 125 | let g:pymode_run_bind='' 126 | imap :w:!clear;python % 127 | ``` 128 | ### Switching Between Buffers 129 | ``` 130 | nmap :bprev 131 | nmap :bnext 132 | ``` 133 | ### Toggle Relative Numbering 134 | ``` 135 | nnoremap :set relativenumber! 136 | ``` 137 | ### Comfortable Motion Scrolling 138 | ``` 139 | let g:comfortable_motion_scroll_down_key = "j" 140 | let g:comfortable_motion_scroll_up_key = "k" 141 | ``` 142 | ``` 143 | nnoremap :call comfortable_motion#flick(g:comfortable_motion_imp ulse_multiplier * winheight(0) * 2) 144 | nnoremap :call comfortable_motion#flick(g:comfortable_motion_imp ulse_multiplier * winheight(0) * -2) 145 | nnoremap :call comfortable_motion#flick(g:comfortable_motion_imp ulse_multiplier * winheight(0) * 4) 146 | nnoremap :call comfortable_motion#flick(g:comfortable_motion_imp ulse_multiplier * winheight(0) * -4) 147 | ``` 148 | 149 | ### NerdTree Toggle 150 | * NerdTree wil automatically open when vim is launched in terminal without a file 151 | ``` 152 | nmap " :NERDTreeToggle 153 | ``` 154 | ### Disable Arrow Keys 155 | ``` 156 | no 157 | no 158 | no 159 | no 160 | 161 | ino 162 | ino 163 | ino 164 | ino 165 | 166 | vno 167 | vno 168 | vno 169 | vno 170 | ``` 171 | 172 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | wrapper() { 3 | # Colors 4 | RED="\033[0;31m" 5 | GREEN="\033[0;32m" 6 | YELLOW="\033[0;33m" 7 | BLUE="\033[0;36m" 8 | NORMAL="\033[0m" 9 | 10 | # Links 11 | REPO_HTTPS="https://github.com/jarolrod/vim-python-ide.git" 12 | VUNDLE_HTTPS="https://github.com/VundleVim/Vundle.vim.git" 13 | PYTHON_INSTALL="https://realpython.com/installing-python/" 14 | GIT_INSTALL="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git" 15 | CMAKE_INSTALL="https://cmake.org/install/" 16 | GIT_TS="https://www.codementor.io/@citizen428/git-tutorial-10-common-git-problems-and-how-to-fix-them-aajv0katd" 17 | YCM_COMPILE="https://github.com/ycm-core/YouCompleteMe#installation" 18 | YCM_INSTALL="https://vimawesome.com/plugin/youcompleteme#installation" 19 | 20 | echo "${NORMAL}" 21 | 22 | # Determine System Type 23 | unameOut="$(uname -s)" 24 | case "${unameOut}" in 25 | Linux*) machine=LINUX;; 26 | Darwin*) machine=MAC;; 27 | CYGWIN*) machine=CYGWIN;; 28 | MINGW*) machine=MINGW;; 29 | *) machine=UNKNOWN;; 30 | esac 31 | SYS_TYPE=${machine} 32 | 33 | # Run System Requirement Checks 34 | printf "${BLUE}%s${NORMAL}\n" "Checking for system requirements." 35 | 36 | # System Requirement Helper Function 37 | open_info() { 38 | case $SYS_TYPE in 39 | LINUX) xdg-open $1;; 40 | MAC) open $1;; 41 | CYGWIN) cygstart $1;; 42 | *) echo "For More Information: $1";; 43 | esac 44 | } 45 | 46 | # Git is required 47 | hash git >/dev/null 2>&1 || { 48 | printf "${RED}%s${NORMAL}\n" "Error: git is not installed." 49 | open_info $GIT_INSTALL 50 | exit 1 51 | } 52 | 53 | # Cmake is required 54 | hash cmake >/dev/null 2>&1 || { 55 | printf "${RED}%s${NORMAL}\n" "Error: cmake is not installed." 56 | open_info $CMAKE_INSTALL 57 | exit 1 58 | } 59 | 60 | # Python >= 3 is required 61 | hash python3 >/dev/null 2>&1 || { 62 | printf "${RED}%s${NORMAL}\n" "Error: python3 is not installed" 63 | open_info $PYTHON_INSTALL 64 | exit 1 65 | } 66 | 67 | if [ ! -n "$VIM" ]; then 68 | VIM=~/.vim 69 | fi 70 | 71 | # Check for existing .vim directory 72 | # Installation connot continue until this directory is removed 73 | if [ -d "$VIM" ]; then 74 | VIM_OLD=~/.vim-backup 75 | printf "${YELLOW}%s${NORMAL}\n" "You already have a $VIM config directory." 76 | printf "${YELLOW}%s${NORMAL}\n" "You must move/delete this directory in order to install." 77 | printf "${YELLOW}%s${NORMAL}\n" "Automatically move $VIM directory to $VIM_OLD?: " 78 | # Ask for input 79 | while true; do 80 | read yn 81 | case $yn in 82 | # Continue: User has entered Yes 83 | [Yy]* ) # Check for existing ~/.vim-backup 84 | if [ -d "$VIM_OLD" ]; then 85 | printf "${YELLOW}%s${NORMAL}\n" "You already have a $VIM_OLD config directory." 86 | printf "${YELLOW}%s${NORMAL}\n" "You must remove this directory in order to install." 87 | printf "${YELLOW}%s${NORMAL}\n" "Automatically delete $VIM_OLD directory: " 88 | 89 | # Ask for input to delete ~/.vim-backup 90 | while true; do 91 | read ny 92 | case $ny in 93 | # Continue: User has entered Yes 94 | [Yy]* ) rm -rf $VIM_OLD && mkdir $VIM_OLD && mv $VIM $VIM_OLD || { 95 | printf "${RED}%s${NORMAL}\n" "Error: Failed to delete $VIM_OLD directory." 96 | printf "${RED}%s${NORMAL}\n" "Installation cannot continue until this is done." 97 | }; 98 | break;; 99 | # Exit: User has entered No 100 | [Nn]* ) 101 | printf "${RED}%s${NORMAL}\n" "Please manually delete the $VIM_OLD directory" 102 | printf "${RED}%s${NORMAL}\n" "After doing so, run the script again." 103 | exit;; 104 | # Invalid Input 105 | * ) echo "Please answer yes or no: ";; 106 | esac 107 | done 108 | 109 | # Continue: There is no ~/.vim-backup 110 | else 111 | mkdir $VIM_OLD && mv $VIM $VIM_OLD || { 112 | printf "${RED}%s${NORMAL}\n" "Error: Failed to move $VIM directory." 113 | printf "${RED}%s${NORMAL}\n" "Installation cannot continue until this is done." 114 | }; 115 | fi 116 | break;; 117 | 118 | # Exit: User has entered No 119 | [Nn]* ) 120 | printf "${RED}%s${NORMAL}\n" "Please manually delete/move the $VIM directory" 121 | printf "${RED}%s${NORMAL}\n" "After doing so, run the script again." 122 | exit;; 123 | # Invalid Input 124 | * ) echo "Please answer yes or no: ";; 125 | esac 126 | done 127 | fi 128 | 129 | # Prevent the cloned repository from having insecure permissions. Failing to do 130 | # so causes compinit() calls to fail with "command not found: compdef" errors 131 | # for users with insecure umasks (e.g., "002", allowing group writability). Note 132 | # that this will be ignored under Cygwin by default, as Windows ACLs take 133 | # precedence over umasks except for filesystems mounted with option "noacl". 134 | umask g-w,o-w 135 | 136 | # Clone VIMRC 137 | printf "${BLUE}%s${NORMAL}\n" "Cloning vimrc from ${REPO_HTTPS}" 138 | env git clone --depth=1 $REPO_HTTPS $VIM || { 139 | printf "${RED}%s${NORMAL}\n" "Error: git clone of vimrc repo failed." 140 | open_info $GIT_TS 141 | exit 1 142 | } 143 | 144 | # Check for an existing vimrc config 145 | printf "${BLUE}%s${NORMAL}\n" "Looking for an existing vim config..." 146 | if [ -f ~/.vimrc ] || [ -h ~/.vimrc ]; then 147 | printf "${YELLOW}%s${NORMAL}\n" "Found ~/.vimrc." 148 | printf "${BLUE}%s${NORMAL}\n" "You will see your old ~/.vimrc as $VIM/vimrc.bak" 149 | mv ~/.vimrc $VIM/vimrc.bak 150 | fi 151 | 152 | # Symlink vimrc files 153 | printf "${BLUE}%s${NORMAL}\n" "Symlinking $VIM/vimrc with ~/.vimrc..." 154 | ln -fs $VIM/vimrc ~/.vimrc 155 | 156 | # Install Bundle 157 | if [ ! -d "$VIM/bundle/Vundle.vim" ]; then 158 | printf "${BLUE}%s${NORMAL}\n" "Installing Vundle..." 159 | env git clone --depth=1 $VUNDLE_HTTPS "$VIM/bundle/Vundle.vim" 160 | fi 161 | 162 | # Install colorscheme 163 | if [ ! -f $VIM/colors/wombat256mod.vim ]; then 164 | if [ ! -d $VIM/colors/ ]; then 165 | mkdir -p $VIM/colors 166 | fi 167 | wget 'http://www.vim.org/scripts/download_script.php?src_id=13400' -O $VIM/colors/wombat256mod.vim 168 | fi 169 | } 170 | 171 | wrapper 172 | 173 | # Automated PluginInstall and YouCompleteMe Compile 174 | vim +PluginInstall +quitall 175 | if [ -d "$VIM/bundle/YouCompleteMe" ]; then 176 | cd $VIM/bundle/YouCompleteMe && python3 install.py --clang-completer || { 177 | echo "Failed to compile YouCompleteMe." 178 | echo "You must compile it yourself in order to use its completion service." 179 | open_info $YCM_COMPILE 180 | } 181 | else 182 | echo "YouCompleteMe was not found in your $VIM bundle directory." 183 | echo "Install this plugin and then compile it in order to use its completion service." 184 | open_info $YCM_INSTALL 185 | fi 186 | vim 187 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | set nocompatible " required 2 | filetype off " required 3 | set hidden 4 | set showtabline=0 5 | 6 | " set the runtime path to include Vundle and initialize 7 | set rtp+=~/.vim/bundle/Vundle.vim 8 | call vundle#begin() 9 | 10 | " alternatively, pass a path where Vundle should install plugins 11 | "call vundle#begin('~/some/path/here') 12 | 13 | " let Vundle manage Vundle, required 14 | Plugin 'gmarik/Vundle.vim' " Vundle Plugin Manager 15 | 16 | " Add all your plugins here (note older versions of Vundle used Bundle instead of Plugin) 17 | "-------------------=== Code/Project navigation ===------------- 18 | Plugin 'scrooloose/nerdtree' " Project and file navigation 19 | Plugin 'Xuyuanp/nerdtree-git-plugin' " NerdTree git functionality 20 | Plugin 'majutsushi/tagbar' " Class/module browser 21 | Plugin 'vim-ctrlspace/vim-ctrlspace' " Tabs/Buffers/Fuzzy/Workspaces/Bookmarks 22 | Plugin 'mileszs/ack.vim' " Ag/Grep 23 | Plugin 'vim-airline/vim-airline' " Lean & mean status/tabline for vim 24 | Plugin 'vim-airline/vim-airline-themes' " Themes for airline 25 | Plugin 'fisadev/FixedTaskList.vim' " Pending tasks list 26 | Plugin 'yuttie/comfortable-motion.vim' " Smooth scrolling 27 | Plugin 'MattesGroeger/vim-bookmarks' " Bookmarks 28 | Plugin 'thaerkh/vim-indentguides' " Visual representation of indents 29 | Plugin 'w0rp/ale' " Async Lint Engine 30 | Plugin 'Valloric/YouCompleteMe' " Code Completion 31 | 32 | "-------------------=== Other ===------------------------------- 33 | Plugin 'tpope/vim-surround' " Parentheses, brackets, quotes, XML tags, and more 34 | Plugin 'flazz/vim-colorschemes' " Colorschemes 35 | Plugin 'vimwiki/vimwiki' " Personal Wiki 36 | Plugin 'jreybert/vimagit' " Git Operations 37 | Plugin 'kien/rainbow_parentheses.vim' " Rainbow Parentheses 38 | Plugin 'ryanoasis/vim-devicons' " Dev Icons 39 | Plugin 'mhinz/vim-startify' " Vim Start Page 40 | "-------------------=== Snippets support ===-------------------- 41 | Plugin 'garbas/vim-snipmate' " Snippets manager 42 | Plugin 'MarcWeber/vim-addon-mw-utils' " dependencies #1 43 | Plugin 'tomtom/tlib_vim' " dependencies #2 44 | Plugin 'honza/vim-snippets' " snippets repo 45 | 46 | "-------------------=== Languages support ===------------------- 47 | Plugin 'scrooloose/nerdcommenter' " Easy code documentation 48 | Plugin 'mitsuhiko/vim-sparkup' " Sparkup(XML/jinja/htlm-django/etc.) support 49 | 50 | "-------------------=== Python ===----------------------------- 51 | Plugin 'klen/python-mode' " Python mode (docs, refactor, lints...) 52 | Plugin 'hynek/vim-python-pep8-indent' 53 | Plugin 'mitsuhiko/vim-python-combined' 54 | Plugin 'mitsuhiko/vim-jinja' 55 | Plugin 'jmcantrell/vim-virtualenv' 56 | 57 | " All of your Plugins must be added before the following line 58 | call vundle#end() " required 59 | filetype on 60 | filetype plugin on 61 | filetype plugin indent on 62 | 63 | "===================================================== 64 | "" General settings 65 | "===================================================== 66 | if filereadable(expand("~/.vimrc_background")) 67 | source ~/.vimrc_background 68 | endif 69 | set encoding=utf-8 70 | set t_Co=256 " 256 colors 71 | set guifont=mononoki\ Nerd\ Font\ 18 72 | colorscheme wombat256mod " set vim colorscheme 73 | let g:airline_theme='wombat' " set airline theme 74 | syntax enable " enable syntax highlighting 75 | 76 | set pyxversion=0 77 | let g:loaded_python_provider = 1 78 | set shell=/bin/bash 79 | set number " show line numbers 80 | set ruler 81 | set ttyfast " terminal acceleration 82 | 83 | set tabstop=4 " 4 whitespaces for tabs visual presentation 84 | set shiftwidth=4 " shift lines by 4 spaces 85 | set smarttab " set tabs for a shifttabs logic 86 | set expandtab " expand tabs into spaces 87 | set autoindent " indent when moving to the next line while writing code 88 | 89 | set cursorline " shows line under the cursor's line 90 | set showmatch " shows matching part of bracket pairs (), [], {} 91 | 92 | set enc=utf-8 " utf-8 by default 93 | 94 | set nobackup " no backup files 95 | set nowritebackup " only in case you don't want a backup file while editing 96 | set noswapfile " no swap files 97 | 98 | set backspace=indent,eol,start " backspace removes all (indents, EOLs, start) What is start? 99 | 100 | set scrolloff=20 " let 10 lines before/after cursor during scroll 101 | 102 | set clipboard=unnamed " use system clipboard 103 | 104 | set exrc " enable usage of additional .vimrc files from working directory 105 | set secure " prohibit .vimrc files to execute shell, create files, etc... 106 | 107 | "===================================================== 108 | "" Tabs / Buffers settings 109 | "===================================================== 110 | tab sball 111 | set switchbuf=useopen 112 | set laststatus=2 113 | nmap :bprev 114 | nmap :bnext 115 | nmap q :SyntasticCheck # :bp bd # 116 | 117 | "===================================================== 118 | "" YouCompleteMe Settings 119 | "===================================================== 120 | 121 | "===================================================== 122 | "" Ale Settings (Linting) 123 | "===================================================== 124 | " Use Ale. 125 | " Show Ale in Airline 126 | let g:airline#extensions#ale#enabled = 1 127 | 128 | " Ale Gutter 129 | let g:ale_sign_column_always = 1 130 | 131 | "===================================================== 132 | "" Relative Numbering 133 | "===================================================== 134 | nnoremap :set relativenumber! 135 | 136 | "===================================================== 137 | "" Search settings 138 | "===================================================== 139 | set incsearch " incremental search 140 | set hlsearch " highlight search results 141 | 142 | "===================================================== 143 | "" Comfortable Motion Settings 144 | "===================================================== 145 | let g:comfortable_motion_scroll_down_key = "j" 146 | let g:comfortable_motion_scroll_up_key = "k" 147 | let g:comfortable_motion_no_default_key_mappings = 1 148 | let g:comfortable_motion_impulse_multiplier = 25 " Feel free to increase/decrease this value. 149 | nnoremap :call comfortable_motion#flick(g:comfortable_motion_impulse_multiplier * winheight(0) * 2) 150 | nnoremap :call comfortable_motion#flick(g:comfortable_motion_impulse_multiplier * winheight(0) * -2) 151 | nnoremap :call comfortable_motion#flick(g:comfortable_motion_impulse_multiplier * winheight(0) * 4) 152 | nnoremap :call comfortable_motion#flick(g:comfortable_motion_impulse_multiplier * winheight(0) * -4) 153 | 154 | "===================================================== 155 | "" AirLine settings 156 | "===================================================== 157 | let g:airline#extensions#tabline#enabled=1 158 | let g:airline#extensions#tabline#formatter='unique_tail' 159 | let g:airline_powerline_fonts=1 160 | 161 | "===================================================== 162 | "" TagBar settings 163 | "===================================================== 164 | let g:tagbar_autofocus=0 165 | let g:tagbar_width=42 166 | autocmd BufEnter *.py :call tagbar#autoopen(0) 167 | autocmd BufWinLeave *.py :TagbarClose 168 | 169 | "===================================================== 170 | "" NERDTree settings 171 | "===================================================== 172 | let NERDTreeIgnore=['\.pyc$', '\.pyo$', '__pycache__$'] " Ignore files in NERDTree 173 | let NERDTreeWinSize=40 174 | nmap " :NERDTreeToggle 175 | 176 | "===================================================== 177 | "" NERDComment Settings 178 | "===================================================== 179 | " Add spaces after comment delimiters by default 180 | let g:NERDSpaceDelims = 1 181 | 182 | " Use compact syntax for prettified multi-line comments 183 | let g:NERDCompactSexyComs = 1 184 | 185 | " Align line-wise comment delimiters flush left instead of following code indentation 186 | let g:NERDDefaultAlign = 'left' 187 | 188 | " Set a language to use its alternate delimiters by default 189 | let g:NERDAltDelims_java = 1 190 | 191 | " Add your own custom formats or override the defaults 192 | let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } } 193 | 194 | " Allow commenting and inverting empty lines (useful when commenting a region) 195 | let g:NERDCommentEmptyLines = 1 196 | 197 | " Enable trimming of trailing whitespace when uncommenting 198 | let g:NERDTrimTrailingWhitespace = 1 199 | 200 | 201 | "===================================================== 202 | "" DevIcon Settings 203 | "===================================================== 204 | " loading the plugin 205 | let g:webdevicons_enable = 1 206 | 207 | " adding the flags to NERDTree 208 | let g:webdevicons_enable_nerdtree = 1 209 | 210 | " adding to vim-airline's tabline 211 | let g:webdevicons_enable_airline_tabline = 1 212 | 213 | " adding to vim-airline's statusline 214 | let g:webdevicons_enable_airline_statusline = 1 215 | 216 | " turn on/off file node glyph decorations (not particularly useful) 217 | let g:WebDevIconsUnicodeDecorateFileNodes = 1 218 | 219 | " use double-width(1) or single-width(0) glyphs 220 | " only manipulates padding, has no effect on terminal or set(guifont) font 221 | let g:WebDevIconsUnicodeGlyphDoubleWidth = 1 222 | 223 | " whether or not to show the nerdtree brackets around flags 224 | let g:webdevicons_conceal_nerdtree_brackets = 0 225 | 226 | " the amount of space to use after the glyph character (default ' ') 227 | let g:WebDevIconsNerdTreeAfterGlyphPadding = ' ' 228 | 229 | " Force extra padding in NERDTree so that the filetype icons line up vertically 230 | let g:WebDevIconsNerdTreeGitPluginForceVAlign = 1 231 | 232 | " change the default character when no match found 233 | let g:WebDevIconsUnicodeDecorateFileNodesDefaultSymbol = 'ƛ' 234 | 235 | " set a byte character marker (BOM) utf-8 symbol when retrieving file encoding 236 | " disabled by default with no value 237 | let g:WebDevIconsUnicodeByteOrderMarkerDefaultSymbol = '' 238 | 239 | " enable folder/directory glyph flag (disabled by default with 0) 240 | let g:WebDevIconsUnicodeDecorateFolderNodes = 1 241 | 242 | " enable open and close folder/directory glyph flags (disabled by default with 0) 243 | let g:DevIconsEnableFoldersOpenClose = 1 244 | 245 | " enable pattern matching glyphs on folder/directory (enabled by default with 1) 246 | let g:DevIconsEnableFolderPatternMatching = 1 247 | 248 | " enable file extension pattern matching glyphs on folder/directory (disabled by default with 0) 249 | let g:DevIconsEnableFolderExtensionPatternMatching = 0 250 | 251 | 252 | "===================================================== 253 | "" SnipMate settings 254 | "===================================================== 255 | let g:snippets_dir='~/.vim/vim-snippets/snippets' 256 | 257 | "===================================================== 258 | "" Rainbow Parentheses Autoload 259 | "===================================================== 260 | au VimEnter * RainbowParenthesesToggle 261 | au Syntax * RainbowParenthesesLoadRound 262 | au Syntax * RainbowParenthesesLoadSquare 263 | au Syntax * RainbowParenthesesLoadBraces 264 | 265 | "===================================================== 266 | "" Indent Guides Settings 267 | "===================================================== 268 | set listchars=tab:›\ ,trail:•,extends:#,nbsp:. 269 | "===================================================== 270 | "" Python settings 271 | "===================================================== 272 | 273 | " python executables for different plugins 274 | let g:pymode_python='python' 275 | 276 | 277 | nmap g :YcmCompleter GoTo 278 | nmap d :YcmCompleter GoToDefinition 279 | 280 | let g:ale_emit_conflict_warnings = 0 281 | let g:airline#extensions#ale#enabled = 1 282 | let g:pymode_rope_lookup_project = 0 283 | let g:airline#extensions#tabline#enabled = 1 284 | 285 | " rope 286 | let g:pymode_rope=0 287 | let g:pymode_rope_completion=0 288 | let g:pymode_rope_complete_on_dot=0 289 | let g:pymode_rope_auto_project=0 290 | let g:pymode_rope_enable_autoimport=0 291 | let g:pymode_rope_autoimport_generate=0 292 | let g:pymode_rope_guess_project=0 293 | 294 | " documentation 295 | let g:pymode_doc=0 296 | let g:pymode_doc_bind='K' 297 | 298 | " lints 299 | let g:pymode_lint=0 300 | 301 | " virtualenv 302 | let g:pymode_virtualenv=1 303 | 304 | " breakpoints 305 | let g:pymode_breakpoint=1 306 | let g:pymode_breakpoint_key='b' 307 | 308 | " syntax highlight 309 | let g:pymode_syntax=1 310 | let g:pymode_syntax_slow_sync=1 311 | let g:pymode_syntax_all=1 312 | let g:pymode_syntax_print_as_function=g:pymode_syntax_all 313 | let g:pymode_syntax_highlight_async_await=g:pymode_syntax_all 314 | let g:pymode_syntax_highlight_equal_operator=g:pymode_syntax_all 315 | let g:pymode_syntax_highlight_stars_operator=g:pymode_syntax_all 316 | let g:pymode_syntax_highlight_self=g:pymode_syntax_all 317 | let g:pymode_syntax_indent_errors=g:pymode_syntax_all 318 | let g:pymode_syntax_string_formatting=g:pymode_syntax_all 319 | let g:pymode_syntax_space_errors=g:pymode_syntax_all 320 | let g:pymode_syntax_string_format=g:pymode_syntax_all 321 | let g:pymode_syntax_string_templates=g:pymode_syntax_all 322 | let g:pymode_syntax_doctests=g:pymode_syntax_all 323 | let g:pymode_syntax_builtin_objs=g:pymode_syntax_all 324 | let g:pymode_syntax_builtin_types=g:pymode_syntax_all 325 | let g:pymode_syntax_highlight_exceptions=g:pymode_syntax_all 326 | let g:pymode_syntax_docstrings=g:pymode_syntax_all 327 | 328 | " highlight 'long' lines (>= 80 symbols) in python files 329 | augroup vimrc_autocmds 330 | autocmd! 331 | autocmd FileType python,rst,c,cpp highlight Excess ctermbg=DarkGrey guibg=Black 332 | autocmd FileType python,rst,c,cpp match Excess /\%81v.*/ 333 | autocmd FileType python,rst,c,cpp set nowrap 334 | autocmd FileType python,rst,c,cpp set colorcolumn=80 335 | augroup END 336 | 337 | " code folding 338 | let g:pymode_folding=0 339 | 340 | " pep8 indents 341 | let g:pymode_indent=1 342 | 343 | " code running 344 | let g:pymode_run=1 345 | let g:pymode_run_bind='' 346 | 347 | let g:ale_sign_column_always = 0 348 | let g:ale_emit_conflict_warnings = 0 349 | let g:airline#extensions#ale#enabled = 1 350 | let g:pymode_rope_lookup_project = 0 351 | let g:airline#extensions#tabline#enabled = 1 352 | 353 | imap :w:!clear;python % 354 | 355 | no 356 | no 357 | no 358 | no 359 | 360 | ino 361 | ino 362 | ino 363 | ino 364 | 365 | vno 366 | vno 367 | vno 368 | vno 369 | 370 | 371 | autocmd StdinReadPre * let g:isReadingFromStdin = 1 372 | autocmd VimEnter * nested if !argc() && !exists('g:isReadingFromStdin') | Startify | endif 373 | autocmd VimEnter * nested if !argc() && !exists('g:isReadingFromStdin') | NERDTree | endif 374 | --------------------------------------------------------------------------------