Changes to i3 and vim

tmux
J. Fernando Sánchez 10 years ago
parent de4b50811b
commit 7c35e64b44

@ -0,0 +1,38 @@
#!/bin/bash
while [ "$select" != "NO" -a "$select" != "YES" ]; do
select=$(echo -e 'NO\nYES' | dmenu -fn "-*-cure-medium-*-*-*-11-*-*-*-*-*-*-*" -nb "#101010" -nf "#5f5f5f" -sb "#191919" -sf "#c72f62" -i -p "Do you really want to exit?");
[ -z "$select" ] && exit 0
done
[ "$select" = "NO" ] && exit 0
i3-msg exit
##!/bin/sh
#lock() {
#i3lock
#}
#case "$1" in
#lock)
#lock
#;;
#logout)
#i3-msg exit
#;;
#suspend)
#lock && systemctl suspend
#;;
#hibernate)
#lock && systemctl hibernate
#;;
#reboot)
#systemctl reboot
#;;
#shutdown)
#systemctl poweroff
#;;
#*)
#echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
#exit 2
#esac
#exit 0

@ -114,7 +114,7 @@ bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
# focus the parent container
bindsym $mod+a focus parent
bindsym $mod+u focus parent
# focus the child container
bindsym $mod+d focus child
@ -150,7 +150,7 @@ bindsym $mod+Shift+C reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+R restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+E exit
bindsym $mod+Shift+E exec exit_i3.sh
bindsym $mod+Mod1+s exec gksudo pm-suspend
# resize window (you can also use the mouse for that)
@ -238,3 +238,18 @@ exec --no-startup-id syndaemon -i 0.5 -d
exec --no-startup-id synapse -s
exec xautolock -time 10 -locker 'i3lock -t -c 000000 -i ~/Pictures/Wallpapers/Game\ Over\ Hacker.png' &
exec urxvt -e tmux attach
#set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
#mode "$mode_system" {
#bindsym l exec --no-startup-id i3exit lock, mode "default"
#bindsym e exec --no-startup-id i3exit logout, mode "default"
#bindsym s exec --no-startup-id i3exit suspend, mode "default"
#bindsym h exec --no-startup-id i3exit hibernate, mode "default"
#bindsym r exec --no-startup-id i3exit reboot, mode "default"
#bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default"
## back to normal: Enter or Escape
#bindsym Return mode "default"
#bindsym Escape mode "default"
#}
#bindsym $mod+Pause mode "$mode_system"

@ -11,8 +11,10 @@ map <leader>ct yyp:s/begin/end/<CR>
let g:tex_flavor = "latex"
set suffixes+=.log,.aux,.bbl,.blg,.idx,.ilg,.ind,.out,.pdf
let g:LatexBox_latexmk_options="-pvc"
let g:Tex_CompileRule_pdf = 'pdflatex --synctex=1 -interaction=nonstopmode $*'
"let g:LatexBox_latexmk_options="-pvc"
let g:LatexBox_latexmk_async=1
let g:LatexBox_latexmk_preview_continuously=1
"let g:Tex_CompileRule_pdf = 'pdflatex --synctex=1 -interaction=nonstopmode $*'
let g:LatexBox_output_type="pdf"
let g:LatexBox_viewer="evince"
let g:LatexBox_Folding=1

135
vimrc

@ -14,27 +14,37 @@ Bundle "tpope/vim-repeat"
Bundle "tpope/vim-unimpaired"
Bundle "tpope/vim-fugitive"
Bundle "tpope/vim-surround.git"
Bundle "tpope/vim-abolish.git"
Bundle "scrooloose/nerdtree"
Bundle "scrooloose/nerdcommenter"
Bundle "scrooloose/syntastic"
Bundle "ervandew/supertab"
Bundle "majutsushi/tagbar"
Bundle "MarcWeber/vim-addon-mw-utils"
"" for vim-snippets
Bundle "tomtom/tlib_vim"
Bundle "honza/vim-snippets"
Bundle "garbas/vim-snipmate"
Bundle "SpellCheck"
Bundle "mattn/gist-vim"
Bundle "mattn/webapi-vim"
Bundle "kien/ctrlp.vim.git"
Bundle "mattn/gist-vim"
Bundle "klen/python-mode"
Bundle "flazz/vim-colorschemes"
Bundle "Lokaltog/vim-distinguished"
Bundle "ivanov/vim-ipython"
Bundle "jamessan/vim-gnupg"
Bundle "Lokaltog/vim-easymotion"
"Bundle 'chriskempson/base16-vim'
Bundle "fholgado/minibufexpl.vim"
Bundle "nanotech/jellybeans.vim"
Bundle "vim-scripts/YankRing.vim"
Bundle "kien/ctrlp.vim.git"
Bundle "sgur/ctrlp-extensions.vim"
Bundle "sjl/gundo.vim"
Bundle "bling/vim-airline"
Bundle "xolox/vim-misc"
Bundle "xolox/vim-notes"
Bundle "beloglazov/vim-online-thesaurus"
Bundle "vim-scripts/ShowMarks"
Bundle "atweiden/vim-dragvisuals"
Bundle "tomasr/molokai"
Bundle "elzr/vim-json"
Bundle "niklasl/vim-rdf"
filetype plugin indent on " required!
@ -68,7 +78,10 @@ set hlsearch
set ruler
set wildmenu
set autoread
"Better Map Leader
" faster commands
noremap <space> :
" Better Map Leader
let mapleader=","
noremap \ ,
@ -89,8 +102,10 @@ imap <C-S> <C-O>:w<CR>
"Custom maps
noremap <Leader>n :NERDTreeToggle<CR>
noremap <Leader>t :TagbarToggle<CR>
noremap <Leader>f :CtrlP<CR>
noremap <Leader>t :TagbarOpen fj<CR>
noremap <Leader>f :CtrlPMixed<CR>
noremap <Leader>b :CtrlPBookmarkDir<CR>
noremap <Leader>l :CtrlPLine<CR>
"Omni
set completeopt=longest,menuone
@ -110,6 +125,7 @@ nnoremap <C-t> :tabnew<CR>
inoremap <C-S-tab> <Esc>:tabprevious<CR>i
inoremap <C-tab> <Esc>:tabnext<CR>i
"inoremap <C-t> <Esc>:tabnew<CR>
nnoremap <leader>dd :bd<CR>
" Save sessions
@ -141,28 +157,28 @@ colo solarized
set statusline=%t%h%m%r%y%{fugitive#statusline()}\%=[%{strlen(&fenc)?&fenc:'none'},%{&ff}]\ \ %c,%l/%L\ %P
set laststatus=2
function! InsertStatuslineColor(mode)
if a:mode == 'i'
hi statusline guibg=Red ctermbg=Red guifg=White ctermfg=White
elseif a:mode == 'r'
hi statusline guibg=Blue ctermfg=White guifg=White ctermbg=Blue
else
hi statusline ctermbg=Yellow guibg=Yellow ctermfg=Black guifg=Black
endif
endfunction
" Now that I use Airline, there is no need for this :)
"function! InsertStatuslineColor(mode)
"if a:mode == 'i'
"hi statusline guibg=Red ctermbg=Red guifg=White ctermfg=White
"elseif a:mode == 'r'
"hi statusline guibg=Blue ctermfg=White guifg=White ctermbg=Blue
"else
"hi statusline ctermbg=Yellow guibg=Yellow ctermfg=Black guifg=Black
"endif
"endfunction
call InsertStatuslineColor('')
"call InsertStatuslineColor('')
"au InsertEnter * call InsertStatuslineColor(v:insertmode)
"au InsertLeave * call InsertStatuslineColor('')
au InsertEnter * call InsertStatuslineColor(v:insertmode)
au InsertLeave * call InsertStatuslineColor('')
au BufRead,BufNewFile *.md set filetype=markdown
"Diff the buffer and the original
command DiffOrig let g:diffline = line('.') | vert new | set bt=nofile | r # | 0d_ | diffthis | :exe "norm! ".g:diffline."G" | wincmd p | diffthis | wincmd p
nnoremap <Leader>do :DiffOrig<cr>
nnoremap <leader>dc :q<cr>:diffoff<cr>:exe "norm! ".g:diffline."G"<cr>
let g:ctrlp_cmd = 'CtrlPMRU'
set guifont=DejaVu\ Sans\ Mono
set foldmethod=syntax
@ -192,13 +208,6 @@ augroup GnuPGExtra
autocmd CursorHold *.\(gpg\|asc\|pgp\) quit
augroup END
" RDF Notation 3 Syntax
augroup filetypedetect
au BufNewFile,BufRead *.n3 setfiletype n3
au BufNewFile,BufRead *.ttl setfiletype n3
augroup END
function SetGPGOptions()
" Set updatetime to 1 minute.
set updatetime=60000
@ -214,5 +223,67 @@ function SetGPGOptions()
set foldopen=insert
endfunction
" CtrlP
" Do not clear the file cache on exit
let g:ctrlp_clear_cache_on_exit = 0
let g:ctrlp_extensions = [ 'mixed' ]
let g:ctrlp_regexp = 0
let g:ctrlp_cmd = 'CtrlPMixed'
" Git things
nmap <leader>gs :Gstatus<cr>
nmap <leader>gd :Gdiff<cr>
nmap <leader>gl :Glog<cr>
" Gundo magic
nnoremap <leader>u :GundoToggle<CR>
" YankRing+Ctrl-P
map <leader>y :YRShow<CR>
let g:yankring_replace_n_pkey = '<c-j>'
let g:yankring_replace_n_nkey = '<c-k>'
let g:airline_left_sep=''
let g:airline_right_sep='|'
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline_theme='base16'
" Notes
:let g:notes_directories = ['~/Dropbox/Notes']
" Block move
vmap <expr> <LEFT> DVB_Drag('left')
vmap <expr> <RIGHT> DVB_Drag('right')
vmap <expr> <DOWN> DVB_Drag('down')
vmap <expr> <UP> DVB_Drag('up')
vmap <expr> D DVB_Duplicate()
function! s:get_visual_selection()
" Why is this not a built-in Vim script function?!
let [lnum1, col1] = getpos("'<")[1:2]
let [lnum2, col2] = getpos("'>")[1:2]
let lines = getline(lnum1, lnum2)
let lines[-1] = lines[-1][: col2 - (&selection == 'inclusive' ? 1 : 2)]
let lines[0] = lines[0][col1 - 1:]
return join(lines, "\n")
endfunction
" Thesaurus
let g:online_thesaurus_map_keys = 0
nnoremap <leader>k :OnlineThesaurusCurrentWord<CR>
vnoremap <leader>k <Esc>:Thesaurus <C-R><C-R>=<SID>get_visual_selection()<CR><CR>
" Resizing
nnoremap <silent> <Leader>+ :exe "resize " . (winheight(0) * 3/2)<CR>
nnoremap <silent> <Leader>- :exe "resize " . (winheight(0) * 2/3)<CR>
nnoremap <silent> <Leader>+ :exe "resize " . (winheight(0) * 3/2)<CR>
nnoremap <silent> <Leader>> :exe "vertical resize " . (winwidth(0) * 3/2)<CR>
nnoremap <silent> <Leader>< :exe "vertical resize " . (winwidth(0) * 2/3)<CR>
" Clipboard magic
if has('unnamedplus')
set clipboard=unnamed,unnamedplus
endif

Loading…
Cancel
Save