Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- filetype off
- set autochdir "working directory is always directory of current file
- filetype plugin on "netrw file browser
- filetype plugin indent on
- "set mouse=a
- "vim-plug
- call plug#begin()
- Plug 'junegunn/limelight.vim'
- Plug 'neoclide/coc.nvim', {'branch': 'release'}
- Plug 'sheerun/vim-polyglot'
- call plug#end()
- "mapping setup
- let mapleader="," "leader is comma
- "echodoc config
- "set cmdheight=2
- let g:echodoc#enable_at_startup = 1
- "let g:echodoc#type = 'virtual'
- "limelight config
- let g:limelight_conceal_ctermfg = 1
- nnoremap <leader>l :Limelight!! 0.85<CR>
- "python-syntax config
- let g:python_highlight_all = 1
- "start python language server
- if executable('pyls')
- " pip install python-language-server
- au User lsp_setup call lsp#register_server({
- \ 'name': 'pyls',
- \ 'cmd': {server_info->['pyls']},
- \ 'whitelist': ['python'],
- \ 'workspace_config': {'pyls': {'plugins': {'pydocstyle': {'enabled': v:true}}}}
- \ })
- endif
- "coc config
- inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
- inoremap <expr><S-tab> pumvisible() ? "\<c-p>" : "\<tab>"
- set hidden
- set nobackup
- set nowritebackup
- set updatetime=300
- set shortmess+=c
- set signcolumn=yes
- "tab mapping
- inoremap <silent><expr> <TAB>
- \ pumvisible() ? "\<C-n>" :
- \ <SID>check_back_space() ? "\<TAB>" :
- \ coc#refresh()
- inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
- function! s:check_back_space() abort
- let col = col('.') - 1
- return !col || getline('.')[col - 1] =~# '\s'
- endfunction
- "enter confirms completion
- inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
- "goto's
- nmap <silent> gd <Plug>(coc-definition)
- nmap <silent> gy <Plug>(coc-type-definition)
- nmap <silent> gi <Plug>(coc-implementation)
- nmap <silent> gr <Plug>(coc-references)
- "documentation bound to ,d
- nnoremap <leader>d :call <SID>show_documentation()<CR>
- function! s:show_documentation()
- if (index(['vim','help'], &filetype) >= 0)
- execute 'h '.expand('<cword>')
- else
- call CocAction('doHover')
- endif
- endfunction
- "rename bound to ,r
- nmap <leader>r <Plug>(coc-rename)
- "mapping
- "map jk to ESC to save time
- inoremap jk <esc>
- "map ,f to open netrw in a vertical split
- nnoremap <leader>f :Vexplore<CR>
- "map ,F to open netrw
- nnoremap <leader>F :Explore<CR>
- "map ,t to make new tab and explore
- nnoremap <leader>t :tab split<CR>:Explore<CR>
- "map ,T to make new tab with same file
- nnoremap <leader>T :tab split<CR>
- "map ,w to close tab
- nnoremap <leader>w :tabclose<CR>
- "map J to previous tab
- nnoremap J :tabp<CR>
- "map K to next tab
- nnoremap K :tabn<CR>
- nnoremap <leader>V :e ~/.config/nvim/init.vim<CR>
- "clear search highlight after search and fix paste insert mode
- nnoremap <leader><space> :nohlsearch<CR>:set nopaste<CR>
- "map j and k to move visually on wrapped lines
- nnoremap j gj
- nnoremap k gk
- "map <C-k> and <C-j> to cycle windows
- nnoremap <C-k> <C-w><C-W>
- nnoremap <C-j> <C-w><S-w>
- "tab settings
- set autoindent "maintain indentation from previous line
- set expandtab "replace tabs with spaces
- set tabstop=4 "amount of spaces in a tab character
- set softtabstop=4 "amount of spaces inserted when tabbing
- set shiftwidth=4 "changes >> and <<, automatic indentation
- set linebreak "word wrapping
- "visual
- "if empty($TMUX) && empty($STY)
- " " See https://gist.github.com/XVilka/8346728.
- " if $COLORTERM =~# 'truecolor' || $COLORTERM =~# '24bit'
- " if has('termguicolors')
- " " See :help xterm-true-color
- " if $TERM =~# '^screen'
- " let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
- " let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
- " endif
- " set termguicolors
- " endif
- " endif
- "endif
- "scheme
- set termguicolors
- "set background=dark
- "colorscheme modest
- colorscheme fadedwolf
- syntax enable "explanatory
- set relativenumber "line numbers aren't absolute
- set nu rnu "hybrid line numbers
- set showcmd "show command being typed
- set cursorline "highlight line being edited
- set wildmenu "visual autocomplete for commands
- set lazyredraw "optimization, especially for macros
- set showmatch "highlight matching [{()}]
- "folding
- set foldmethod=syntax
- "searching
- set path+=** "search downward with depth of 30 from working dir, **n changes the amount of layers
- set incsearch "search as you enter characters
- set hlsearch "highlight matches
- "netrw
- let g:netrw_liststyle = 3 "change default directory view
- let g:netrw_banner = 0 "banner off on startup, I to view
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement