call plug#begin() " NERDTree stuff Plug 'kyazdani42/nvim-web-devicons' " optional, for file icons Plug 'kyazdani42/nvim-tree.lua' Plug 'scrooloose/nerdtree' Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'preservim/nerdcommenter' Plug 'mhinz/vim-startify' Plug 'rmagatti/auto-session' Plug 'tpope/vim-fugitive' Plug 'Glench/Vim-Jinja2-Syntax' Plug 'vmware-archive/salt-vim' Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'honza/vim-snippets' Plug 'itchyny/vim-cursorword' Plug 'sheerun/vim-polyglot' Plug 'olimorris/onedarkpro.nvim' Plug 'ellisonleao/gruvbox.nvim' Plug 'dracula/vim' "Fuzzy search by Telescope and its dependencies: Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim', { 'branch': '0.1.x' } Plug 'BurntSushi/ripgrep' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} call plug#end() " load lua file (empty for now) lua require("general") "autocmd BufEnter *.sls :setlocal filetype=yaml "inoremap: maps the key in insert mode "nnoremap: maps the key in normal mode "vnoremap: maps the key in visual mode " : represents Control key " : Alt key "nerdtree bindings nnoremap n :NvimTreeFocus nnoremap :NvimTreeToggle nnoremap :NvimTreeFindFile " nerdcommenter custom bindings nmap NERDCommenterToggle vmap NERDCommenterToggle " show uncommited git changes in current part of the code nnoremap :CocCommand git.chunkInfo "theme configuration syntax enable set termguicolors colorscheme gruvbox let g:airline_theme='dark' set splitright set splitbelow " indent/unindent with tab/shift-tab nmap >> nmap << imap < >gv vmap and for scroll float windows/popups. if has('nvim-0.4.0') || has('patch-8.2.0750') nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" endif " Find files using Telescope command-line sugar. nnoremap ff Telescope find_files nnoremap fg Telescope live_grep nnoremap fb Telescope buffers nnoremap fh Telescope help_tags " config for coc#pum#visible " Some servers have issues with backup files, see #649. set nobackup set nowritebackup " Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable " delays and poor user experience. set updatetime=300 " Always show the signcolumn, otherwise it would shift the text each time " diagnostics appear/become resolved. set signcolumn=yes " Symbol renaming. nmap rn (coc-rename) " Formatting selected code. xmap ft (coc-format-selected) nmap ft (coc-format-selected) " GoTo code navigation. nmap gd (coc-definition) nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) " Use tab for trigger completion with characters ahead and navigate. " NOTE: There's always complete item selected by default, you may want to enable " no select by `"suggest.noselect": true` in your configuration file. " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " other plugin before putting this into your config. inoremap \ coc#pum#visible() ? coc#pum#next(1) : \ CheckBackspace() ? "\" : \ coc#refresh() inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" " Make to accept selected completion item or notify coc.nvim to format " u breaks current undo, please make your own choice. inoremap coc#pum#visible() ? coc#pum#confirm() \: "\u\\=coc#on_enter()\" function! CheckBackspace() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction " Use to trigger completion. if has('nvim') inoremap coc#refresh() else inoremap coc#refresh() endif " general configs set modeline let g:sls_use_jinja_syntax = 1 set encoding=UTF-8 set showmatch " show matching set ignorecase " case insensitive set mouse=v " middle-click paste with set hlsearch " highlight search set incsearch " incremental search set tabstop=4 " number of columns occupied by a tab set softtabstop=4 " see multiple spaces as tabstops so does the right thing set expandtab " converts tabs to white space set shiftwidth=4 " width for autoindents set autoindent " indent a new line the same amount as the line just typed set number " add line numbers set relativenumber " add relative line numbers set wildmode=longest,list " get bash-like tab completions set cc=80 " set an 80 column border for good coding style filetype plugin indent on "allow auto-indenting depending on file type syntax on " syntax highlighting "set mouse=a " enable mouse click set clipboard=unnamedplus " using system clipboard filetype plugin on set cursorline " highlight current cursorline set ttyfast " Speed up scrolling in Vim " set spell " enable spell check (may need to download language package) set noswapfile " disable creating swap file " set backupdir=~/.cache/vim " Directory to store backup files.