Commit ad8717e8 authored by Nelso Jost's avatar Nelso Jost

ADD: more vim settings; keyboard simulate with xmodmap

parent ba0e9d90
keycode 84 = KP_Down
" --- https://github.com/junegunn/vim-plug ------------------------------
" Minimalist plugin manager. Update with --> :PlugInstall
"
" --- https://github.com/junegunn/vim-plug ------------------------------
" Minimalist plugin manager. Update with --> :PlugInstall
"
call plug#begin('~/.local/share/nvim/plugged')
Plug 'flazz/vim-colorschemes' " molokai, PaperColor, etc
......@@ -13,19 +13,26 @@ Plug 'kien/ctrlp.vim' " fuzzy finder (files, buffer, tags)
Plug 'jiangmiao/auto-pairs' " Insert quotes/brackets in pairs
Plug 'tpope/vim-obsession' " create/restore vim sessions
Plug 'scrooloose/nerdtree' " tree explorer
"Plug 'Shougo/deoplete.nvim'
Plug 'plasticboy/vim-markdown' " markdown syntax
Plug 'benmills/vimux' " exec commands on tmux panels
Plug 'xolox/vim-misc'
Plug 'xolox/vim-colorscheme-switcher'
"Plug 'lvht/tagbar-markdown'
Plug 't4ku/marktag'
Plug 'octol/vim-cpp-enhanced-highlight'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
"Plug 'davidhalter/jedi'
"Plug 'zchee/deoplete-jedi'
"Plug 'zchee/deoplete-jedi'
" Plug 'davidhalter/jedi-vim'
Plug 'roxma/nvim-completion-manager' " async, dynamic, completion
"Plug 'roxma/nvim-completion-manager' " async, dynamic, completion
call plug#end()
" -----------------------------------------------------------------------
colorscheme molokai
colorscheme nelsobaka
behave mswin
set clipboard=unnamed
......@@ -99,11 +106,17 @@ imap <F2> :TagbarToggle<CR>
nmap <F3> :NERDTreeToggle<CR>
nnoremap <C-e> :update<CR>:VimuxRunCommand "make"<CR>
nnoremap <c-d> :update<CR>:VimuxRunLastCommand<CR>
map <F8> :PrevColorScheme<CR>
map <F9> :NextColorScheme<CR>
map <F10> :ed ~/.config/nvim/init.vim<cr>
" open terminal split [term-split.vim]
map <C-t> :50VTerm<CR>
map <C-e> :40VTerm make<CR>
"map <C-t> :50VTerm<CR>
"map <C-e> :40VTerm make<CR>
" delete buffer without closing the window [bclose.vim]
nnoremap q :Sayonara<cr>
......@@ -116,6 +129,11 @@ inoremap <C-q> <Esc>:Sayonara<cr>
map <Return> <C-g><leader>c<space>
smap <Return> <C-g><leader>c<space>
" delete previous word
" imap <C-BS> <C-W>
set backspace=indent,eol,start
" delete word under cursor
noremap <C-Space> ciw
inoremap <C-Space> <ESC>ciw
......@@ -123,12 +141,12 @@ inoremap <C-Space> <ESC>ciw
" easy tab ident
vnoremap <Tab> >
vnoremap <S-Tab> <
" easier split navigation
map <C-S-Left> <C-w>h
map <C-S-Right> <C-w>l
map <C-S-Down> <C-w>j
map <C-S-Up> <C-w>k
"map <C-S-Left> <C-w>h
"map <C-S-Right> <C-w>l
"map <C-S-Down> <C-w>j
"map <C-S-Up> <C-w>k
nmap <Tab> <C-w>w
" move cursor by n lines
......@@ -197,7 +215,7 @@ let g:ctrlp_custom_ignore = {
let g:tagbar_map_togglesort = "r"
let g:tagbar_map_preview = "<CR>"
let g:tagbar_map_jump = "<C-CR>"
let g:tagbar_autofocus = 1
let g:tagbar_autofocus = 1
let g:tagbar_expand = 1
let g:tagbar_indent = 1
let g:tagbar_compact = 1
......@@ -205,10 +223,21 @@ let g:tagbar_sort = 0
let g:tagbar_width = 25
" don't give |ins-completion-menu| messages. For example,
" '-- XXX completion (YYY)', 'match 1 of 2', 'The only match',
"set shortmess+=c
"let g:deoplete#enable_at_startup=1
"let g:deoplete#enable_refresh_always=0
"let g:deoplete#file#enable_buffer_path=1
"let g:deoplete#auto_completion_start_length = 0
"
"" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function() abort
return deoplete#close_popup() . "\<CR>"
endfunction
"function! Completefunc(findstart, base)
"return "\<c-x>\<c-p>"
......@@ -238,7 +267,7 @@ let g:tagbar_width = 25
"inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
"inoremap <expr> <CR> (pumvisible() ? "\<c-y>\<cr>" : "\<CR>")
"set shortmess+=c
"set shortmess+=c
"let g:cm_auto_popup = 0
"
......@@ -272,8 +301,58 @@ inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
"endif
" https://github.com/scrooloose/nerdtree
" https://github.com/scrooloose/nerdtree
" How can I open a NERDTree automatically when vim starts up if no files were specified?
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
let g:vim_markdown_folding_disabled = 1
"au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown tw=80 fo+=t colorcolumn=80
"=======================================================================
" http://vim.wikia.com/wiki/Move_cursor_by_display_lines_when_wrapping
noremap <silent> <Leader>w :call ToggleWrap()<CR>
function ToggleWrap()
if &wrap
echo "Wrap OFF"
setlocal nowrap
set virtualedit=all
silent! nunmap <buffer> <Up>
silent! nunmap <buffer> <Down>
silent! nunmap <buffer> <Home>
silent! nunmap <buffer> <End>
silent! iunmap <buffer> <Up>
silent! iunmap <buffer> <Down>
silent! iunmap <buffer> <Home>
silent! iunmap <buffer> <End>
else
echo "Wrap ON"
setlocal wrap linebreak nolist
set virtualedit=
setlocal display+=lastline
noremap <buffer> <silent> <Up> gk
noremap <buffer> <silent> <Down> gj
noremap <buffer> <silent> <Home> g<Home>
noremap <buffer> <silent> <End> g<End>
inoremap <buffer> <silent> <Up> <C-o>gk
inoremap <buffer> <silent> <Down> <C-o>gj
inoremap <buffer> <silent> <Home> <C-o>g<Home>
inoremap <buffer> <silent> <End> <C-o>g<End>
endif
endfunction
" http://vim.wikia.com/wiki/Remove_unwanted_spaces
autocmd BufWritePre * %s/\s\+$//e
let g:tagbar_type_markdown = {
\ 'ctagstype' : 'markdown',
\ 'kinds' : [
\ 'h:Heading_L1',
\ 'i:Heading_L2',
\ 'k:Heading_L3'
\ ]
\ }
......@@ -14,11 +14,20 @@ setw -g pane-base-index 1
# https://github.com/neovim/neovim/issues/2035
set -sg escape-time 0
# enter scroll/copy-mode with pageup
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind -n Pageup if-shell "$is_vim" "send-keys Pageup" "copy-mode -u"
bind -n S-Pageup if-shell "$is_vim" "send-keys Pageup" "copy-mode -u"
bind -n S-Pagedown send-keys Pagedown
# send xterm keys to apps like vim
set-window-option -g xterm-keys on
bind-key s split-window -h -l 55
bind-key v split-window -v
bind-key C-q kill-server
bind-key C-q kill-server
bind-key C-w kill-window
#run-shell ~/resurrect.tmux
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment