Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """ BASIC SETTINGS
- " colorscheme delek
- syntax enable
- set tabstop=4
- set softtabstop=4
- set expandtab
- set number
- set relativenumber
- set showcmd
- " set cursorline
- set clipboard=unnamed
- " filetype indent on
- set wildmenu
- set lazyredraw
- set showmatch
- set incsearch
- set hlsearch
- nnoremap j gj
- nnoremap k gk
- tnoremap <Esc> <C-\><C-n>
- set autoindent
- set shiftwidth=4
- set undofile
- set undodir=~/.vim/undodir
- " imap jj <Esc>
- " imap kk <Esc>
- au VimEnter * silent! !xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'
- " au VimLeave * silent! !xmodmap -e 'clear Lock' -e 'keycode 0x42 = Caps_Lock'
- """ PLUGIN SETUP
- set nocompatible
- filetype off
- call plug#begin('~/.vim/plugged')
- Plug 'scrooloose/nerdtree'
- Plug 'Raimondi/delimitMate'
- Plug 'ayu-theme/ayu-vim'
- Plug 'altercation/vim-colors-solarized'
- Plug 'Shougo/deoplete.nvim'
- " Plug 'xavierd/clang_complete'
- Plug 'zchee/deoplete-clang'
- call plug#end()
- filetype plugin indent on
- """ COLOR THEMEING
- set termguicolors
- let ayucolor = 'mirage'
- colorscheme ayu
- """ AUTOCOMPLETION
- let g:deoplete#enable_on_startup = 1
- call deoplete#enable()
- let g:deoplete#sources#clang#libclang_path='/usr/lib/llvm-7/lib/libclang.so.1'
- set completeopt-=preview
- function! s:check_back_space() abort "{{{
- let col = col('.') - 1
- return !col || getline('.')[col - 1] =~ '\s'
- endfunction"}}}
- inoremap <silent><expr> <TAB>
- \ pumvisible() ? "\<C-n>" :
- \ <SID>check_back_space() ? "\<TAB>" :
- \ deoplete#manual_complete()
- """ NERD TREE
- map <C-n> :NERDTreeToggle<CR>
- """ COMPILATION COMMANDS
- autocmd filetype cpp nnoremap <C-b> :w <CR> :!g++ -std=c++11 % -o %:r && ./%:r <CR>
- autocmd filetype cpp nnoremap <C-t> :w <CR> :term g++ -std=c++11 % -o %:r && ./%:r <CR>
- autocmd filetype java nnoremap <C-b> :w <CR> :!javac % && java %:r <CR>
- autocmd filetype java nnoremap <C-t> :w <CR> :term javac % && java %:r <CR>
- """ TERMINAL NEOVIM
- function! s:termclose() abort
- let buf = expand('#')
- if !empty(buf) && buflisted(buf) && bufnr(buf) != bufnr('%')
- execute 'autocmd BufWinLeave <buffer> split' buf
- endif
- endfunction
- autocmd TermClose *:$SHELL,*:\$SHELL call s:termclose()
- """ SYNTAX HIGHLIGHTING
- au BufReadPost,BufNewFile *.cpp syntax keyword cppType ll
- au BufReadPost,BufNewFile *.cpp syntax keyword cppType ldouble
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement