Skip to content

Instantly share code, notes, and snippets.

@kevin47
Created May 6, 2021 08:15
Show Gist options
  • Save kevin47/2dad9bc452bfbf246323cb7d79be8122 to your computer and use it in GitHub Desktop.
Save kevin47/2dad9bc452bfbf246323cb7d79be8122 to your computer and use it in GitHub Desktop.
set nocompatible " be iMproved, required
set encoding=utf-8
set fileencodings=utf8,big5,gbk,latin1
filetype off " required
let g:ycm_key_list_select_completion = ['<TAB>']
inoremap <Down> <C-R>=pumvisible() ? "\<lt>C-y>\<lt>Down>" : "\<lt>Down>"<CR>
inoremap <Esc>[B <C-R>=pumvisible() ? "\<lt>C-y>\<lt>Down>" : "\<lt>Down>"<CR>
inoremap <Esc>OB <C-R>=pumvisible() ? "\<lt>C-y>\<lt>Down>" : "\<lt>Down>"<CR>
let g:ycm_key_list_select_previous_completion = ['<S-Tab>']
inoremap <Up> <C-R>=pumvisible() ? "\<lt>C-y>\<lt>Up>" : "\<lt>Up>"<CR>
inoremap <Esc>[A <C-R>=pumvisible() ? "\<lt>C-y>\<lt>Up>" : "\<lt>Up>"<CR>
inoremap <Esc>OA <C-R>=pumvisible() ? "\<lt>C-y>\<lt>Up>" : "\<lt>Up>"<CR>
let g:ycm_autoclose_preview_window_after_insertion = 1
set nu
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
:command WQ wq
:command Wq wq
:command W w
:command Q q
:set hlsearch
:set cursorline
" hide underline
highlight CursorLine term=bold cterm=bold guibg=Grey40
highlight CursorLine ctermbg=223
"colorscheme monokai
"set t_Co=256
"set term=screen-256color
syntax on
set wildmenu
set mouse=a
" jump to the last position when opening a file
autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g'\"" | endif
" Disable Arrow keys in Escape mode
"map <up> <nop>
"map <down> <nop>
"map <left> <nop>
"map <right> <nop>
" Disable Arrow keys in Insert mode
"imap <up> <nop>
"imap <down> <nop>
"imap <left> <nop>
"imap <right> <nop>
imap jk <Esc>
imap jK <Esc>
imap Jk <Esc>
imap JK <Esc>
"imap kj <Esc>
autocmd FileType make setlocal noexpandtab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment