Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- call plug#begin('~/.vim/plugged')
- "autosave feature
- "Plug 'vim-scripts/vim-auto-save' "(no need now...)
- "pretty nice status bar
- Plug 'vim-airline/vim-airline'
- "themes for status bar higher
- Plug 'vim-airline/vim-airline-themes'
- "plugin for git diff (shows -, + or ~ on the fields)
- Plug 'airblade/vim-gitgutter'
- "Plugin for git commands and nice interface (do i need it?)
- "Plug 'tpope/vim-fugitive'
- "plugin for autoformat (default formatters can see on the Internet)
- "just type :Autoformat (works with tabs and spaces after function name)
- Plug 'Chiel92/vim-autoformat'
- "plugin for markdown preview
- if !has('nvim')
- Plug 'iamcco/markdown-preview.vim'
- endif
- if has('nvim')
- Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() } }
- endif
- "plugin for syntax highlighting
- Plug 'sheerun/vim-polyglot'
- "show git changes on the fields (for nerd tree)
- Plug 'Xuyuanp/nerdtree-git-plugin'
- "multifile project
- Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
- "colourful names (?)
- Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
- "icons for nerdtree
- Plug 'ryanoasis/vim-devicons'
- "automatically adds second `(` and etc.
- Plug 'jiangmiao/auto-pairs'
- "plugin for autocomplete
- Plug 'neoclide/coc.nvim', {'branch' : 'release'}
- "autocomplete python
- "Plug 'davidhalter/jedi-vim' (works good, but very heavy plug....)
- "finder of the file in the project (ctrl + p and the name of the file)
- Plug 'kien/ctrlp.vim'
- "Just hit "\cm" (i = individual, m - minimal, check repo for info)
- "to leave a comment (also works in visual mode)
- Plug 'scrooloose/nerdcommenter'
- "here is plugin with many different themes (can find on github)
- Plug 'rafi/awesome-vim-colorschemes'
- call plug#end()
- set cursorline
- set number
- set relativenumber
- " change mode if I'm not focused on the win (realativenumber -> number)
- :augroup numbertoggle
- : autocmd!
- : autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
- : autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
- :augroup END
- set expandtab
- set encoding=UTF-8
- set tabstop=4
- set shiftwidth=4
- syntax on
- "theme for tabs and panel
- let g:airline_theme='luna'
- let g:airline#extensions#tabline#enabled = 1
- "theme for whole vim
- colorscheme gruvbox
- set background=dark
- "resetting background must be after theme configuration
- highlight Normal ctermbg=NONE guibg=NONE
- set is
- set hls
- "need this to show tabs if they exists
- set list
- set listchars=tab:>-
- set langmap=ёйцукенгшщзхъфывапролджэячсмитьбюЁЙЦУКЕHГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ;`qwertyuiop[]asdfghjkl\\;'zxcvbnm\\,.~QWERTYUIOP{}ASDFGHJKL:\\"ZXCVBNM<>
- map <C-n> :NERDTreeToggle<CR>
- "mappings for tabs in vim
- if !has('nvim')
- map w :tabclose<CR>
- map m :tabnew<CR>
- map i :tabn<CR>
- map u :tabp<CR>
- endif
- "mappings for windows in vim
- if !has('nvim')
- map q <C-w>q
- map v <C-w>n
- map n <C-w>v
- map k <C-w>k
- map h <C-w>h
- map l <C-w>l
- map j <C-w>j
- map e <C-w>=
- map . <C-w><
- map , <C-w>>
- map - <C-w>-
- map = <C-w>+
- endif
- "mappings for tabs in vim
- if has('nvim')
- map <M-w> :tabclose<CR>
- map <M-m> :tabnew<CR>
- map <M-i> :tabn<CR>
- map <M-u> :tabp<CR>
- endif
- "mappings for windows in vim
- if has('nvim')
- map <M-q> q
- map <M-v> n
- map <M-n> v
- map <M-k> k
- map <M-h> h
- map <M-l> l
- map <M-j> j
- map <M-e> =
- map <M-.> <
- map <M-,> >
- map <M--> -
- map <M-=> +
- endif
- "
- "keybindings for tabs-work
- "map <C-t>n :tabnew<CR>
- "map <C-t>q :tabclose<CR>
- "map <C-t>k :tabr<CR>
- "map <C-t>j :tabl<CR>
- "map <C-t>h :tabp<CR>
- "map <C-t>l :tabn<CR>
- nnoremap <C-j> :m .+1<CR>
- nnoremap <C-k> :m .-2<CR>
- vnoremap <C-j> :m '>+1<CR>gv=gv
- vnoremap <C-k> :m '<-2<CR>gv=gv
- "CONFIGURATION FOR COC
- let g:coc_global_extensions = ['coc-ccls', 'coc-json', 'coc-python', 'coc-highlight']
- "coc.preferences.jumpCommand": "drop"
- " if hidden is not set, TextEdit might fail.
- set hidden
- " Some servers have issues with backup files, see #649
- set nobackup
- set nowritebackup
- " Better display for messages
- set cmdheight=2
- " You will have bad experience for diagnostic messages when it's default 4000.
- set updatetime=300
- " don't give |ins-completion-menu| messages.
- set shortmess+=c
- " always show signcolumns
- set signcolumn=yes
- " Use tab for trigger completion with characters ahead and navigate.
- " Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
- 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
- " Use <c-space> to trigger completion.
- inoremap <silent><expr> <c-space> coc#refresh()
- " Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
- " Coc only does snippet and additional edit on confirm.
- inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
- " Or use `complete_info` if your vim support it, like:
- " inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
- " Use `[g` and `]g` to navigate diagnostics
- nmap <silent> [g <Plug>(coc-diagnostic-prev)
- nmap <silent> ]g <Plug>(coc-diagnostic-next)
- " Remap keys for gotos
- 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)
- " Use K to show documentation in preview window
- nnoremap <silent> K :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
- " Highlight symbol under cursor on CursorHold
- autocmd CursorHold * silent call CocActionAsync('highlight')
- " Remap for rename current word
- nmap <leader>rn <Plug>(coc-rename)
- " Remap for format selected region
- xmap <leader>f <Plug>(coc-format-selected)
- nmap <leader>f <Plug>(coc-format-selected)
- augroup mygroup
- autocmd!
- " Setup formatexpr specified filetype(s).
- autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
- " Update signature help on jump placeholder
- autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
- augroup end
- " Remap for do codeAction of selected region, ex: `<leader>aap` for current paragraph
- xmap <leader>a <Plug>(coc-codeaction-selected)
- nmap <leader>a <Plug>(coc-codeaction-selected)
- " Remap for do codeAction of current line
- nmap <leader>ac <Plug>(coc-codeaction)
- " Fix autofix problem of current line
- nmap <leader>qf <Plug>(coc-fix-current)
- " Create mappings for function text object, requires document symbols feature of languageserver.
- xmap if <Plug>(coc-funcobj-i)
- xmap af <Plug>(coc-funcobj-a)
- omap if <Plug>(coc-funcobj-i)
- omap af <Plug>(coc-funcobj-a)
- " Use <TAB> for select selections ranges, needs server support, like: coc-tsserver, coc-python
- nmap <silent> <TAB> <Plug>(coc-range-select)
- xmap <silent> <TAB> <Plug>(coc-range-select)
- " Use `:Format` to format current buffer
- command! -nargs=0 Format :call CocAction('format')
- " Use `:Fold` to fold current buffer
- command! -nargs=? Fold :call CocAction('fold', <f-args>)
- " use `:OR` for organize import of current buffer
- command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
- " Add status line support, for integration with other plugin, checkout `:h coc-status`
- "set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
- " Using CocList
- " Show all diagnostics
- nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr>
- " Manage extensions
- nnoremap <silent> <space>e :<C-u>CocList extensions<cr>
- " Show commands
- nnoremap <silent> <space>c :<C-u>CocList commands<cr>
- " Find symbol of current document
- nnoremap <silent> <space>o :<C-u>CocList outline<cr>
- " Search workspace symbols
- nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr>
- " Do default action for next item.
- nnoremap <silent> <space>j :<C-u>CocNext<CR>
- " Do default action for previous item.
- nnoremap <silent> <space>k :<C-u>CocPrev<CR>
- " Resume latest coc list
- nnoremap <silent> <space>p :<C-u>CocListResume<CR>
- if has('nvim')
- " set to 1, nvim will open the preview window after entering the markdown buffer
- " default: 0
- let g:mkdp_auto_start = 0
- " set to 1, the nvim will auto close current preview window when change
- " from markdown buffer to another buffer
- " default: 1
- let g:mkdp_auto_close = 0
- " set to 1, the vim will refresh markdown when save the buffer or
- " leave from insert mode, default 0 is auto refresh markdown as you edit or
- " move the cursor
- " default: 0
- let g:mkdp_refresh_slow = 0
- " set to 1, the MarkdownPreview command can be use for all files,
- " by default it can be use in markdown file
- " default: 0
- let g:mkdp_command_for_global = 0
- " set to 1, preview server available to others in your network
- " by default, the server listens on localhost (127.0.0.1)
- " default: 0
- let g:mkdp_open_to_the_world = 0
- " use custom IP to open preview page
- " useful when you work in remote vim and preview on local browser
- " more detail see: https://github.com/iamcco/markdown-preview.nvim/pull/9
- " default empty
- let g:mkdp_open_ip = ''
- " specify browser to open preview page
- " default: ''
- let g:mkdp_browser = ''
- " set to 1, echo preview page url in command line when open preview page
- " default is 0
- let g:mkdp_echo_preview_url = 0
- " a custom vim function name to open preview page
- " this function will receive url as param
- " default is empty
- let g:mkdp_browserfunc = ''
- " options for markdown render
- " mkit: markdown-it options for render
- " katex: katex options for math
- " uml: markdown-it-plantuml options
- " maid: mermaid options
- " disable_sync_scroll: if disable sync scroll, default 0
- " sync_scroll_type: 'middle', 'top' or 'relative', default value is 'middle'
- " middle: mean the cursor position alway show at the middle of the preview page
- " top: mean the vim top viewport alway show at the top of the preview page
- " relative: mean the cursor position alway show at the relative positon of the preview page
- " hide_yaml_meta: if hide yaml metadata, default is 1
- " sequence_diagrams: js-sequence-diagrams options
- let g:mkdp_preview_options = {
- \ 'mkit': {},
- \ 'katex': {},
- \ 'uml': {},
- \ 'maid': {},
- \ 'disable_sync_scroll': 0,
- \ 'sync_scroll_type': 'middle',
- \ 'hide_yaml_meta': 1,
- \ 'sequence_diagrams': {}
- \ }
- " use a custom markdown style must be absolute path
- let g:mkdp_markdown_css = ''
- " use a custom highlight style must absolute path
- let g:mkdp_highlight_css = ''
- " use a custom port to start server or random for empty
- let g:mkdp_port = ''
- " preview page title
- " ${name} will be replace with the file name
- let g:mkdp_page_title = '「${name}」'
- endif
- {
- "languageserver": {
- "ccls": {
- "command": "/home/justar/freespace/third_party/ccls/Release/ccls",
- "filetypes": ["c", "cpp", "objc", "objcpp"],
- "rootPatterns": [
- ".ccls",
- "compile_commands.json",
- ".vim/",
- ".git/",
- ".hg/"
- ],
- "initializationOptions": {
- "cache": {
- "directory": "/tmp/ccls"
- }
- },
- "clang": {
- "resourceDir": "/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0",
- "extraArgs": [
- "-isystem",
- "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
- "-I",
- "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/"
- ]
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement