add vi mode to zsh and fzf to vim

This commit is contained in:
CramMK
2020-06-15 12:47:10 +02:00
parent 2c37d21295
commit ac59749c55
6 changed files with 54 additions and 16 deletions

Submodule dotdrop updated: 18a61bce60...5330d395b3

View File

@@ -9,7 +9,7 @@ opacity-rule = [
# Blur
blur-background = true;
blur-method = "kawase";
blur-strength = 4;
blur-strength = 6;
# Other
vsync = true;

View File

@@ -198,8 +198,10 @@ exec --no-startup-id "firefox"
for_window [class="Firefox"] move container to workspace 9
# Monitors
set $monitor1 "HDMI-1" # Primary
set $monitor2 "HDMI-2" # Secondary
# Primary
set $monitor1 "HDMI-1"
# Secondary
set $monitor2 "HDMI-2"
workspace $ws10 output $monitor2
workspace $ws9 output $monitor2
@@ -228,8 +230,10 @@ for_window [class="Chromium"] move container to workspace 9
for_window [class="Firefox"] move container to workspace 9
# Monitors
set $monitor1 "eDP-1" # Integrated
set $monitor2 "HDMI-1" # pot. Secondary
# Integrated
set $monitor1 "eDP-1"
# potential Secondary
set $monitor2 "HDMI-1"
workspace $ws10 output $monitor2

View File

@@ -35,7 +35,7 @@ def list_wallpapers(wallpaper_list, *args):
if __name__ == "__main__":
### DEFAULT WALLPAPER DIRECTORY HERE
path = "."
path = "wallpaper"
parser = argparse.ArgumentParser()
parser.add_argument("-q", "--query", help="Refine selection")

View File

@@ -1,3 +1,4 @@
let mapleader = "\<Space>"
" ------------------------------------- Vundle Setup ---------------------------
set nocompatible
set rtp+=~/.vim/bundle/Vundle.vim
@@ -7,9 +8,15 @@ Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive' " Git wrapper
Plugin 'tmsvg/pear-tree' " parathesis matching
" Markdown
Plugin 'vimwiki/vimwiki'
Plugin 'dhruvasagar/vim-table-mode' " manage markdown tables
" fzf
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
" Colors
Plugin 'arcticicestudio/nord-vim'
Plugin 'vim-airline/vim-airline'
@@ -43,6 +50,9 @@ let g:airline_powerline_fonts = 1
let g:bufferline_echo = 0
set guifont="InconsolataLGC Nerd Font Mono"
" fzf
nmap <C-f> :Files<CR>
" ------------------------------------- Colors ---------------------------------
syntax on
colorscheme nord
@@ -100,14 +110,13 @@ set foldnestmax=30
set foldmethod=indent
" ------------------------------------- netrw ----------------------------------
map <C-f> :Ex <CR>
nmap <C-e> :Ex <CR>
let g:netrw_winsize = 25
let g:netrw_liststyle = 3 " Tree-like structure
let g:netrw_banner = 0 " Remove useless banner at the top of netrw
" ------------------------------------- Macros & Mappings ----------------------
let mapleader = "\<Space>"
cmap Wq wq
cmap Q q
cmap W w
@@ -120,6 +129,6 @@ if has("autocmd")
endif
" ------------------------------------- Pandoc ---------------------------------
map <leader>c :w! \| !~/scripts/pandoc-comp <c-r>%<CR><CR>
map <leader>o :!~/scripts/open-pdf <c-r>%<CR><CR>
nmap <leader>c :w! \| !~/scripts/pandoc-comp <c-r>%<CR><CR>
nmap <leader>o :!~/scripts/open-pdf <c-r>%<CR><CR>

View File

@@ -8,12 +8,19 @@ DISABLE_UNTRACKED_FILES_DIRTY="true"
plugins=(
git
common-aliases
compleat
history
common-aliases
ssh-agent
vi-mode
)
# https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins
# git: git shortcuts
# compleat: complete flags
# common-aliases: the name says it
# ssh-agent: preload ssh-keys
# vi-mode: use vim-bindings in zsh
zstyle :omz:plugins:ssh-agent identities
source $ZSH/oh-my-zsh.sh
@@ -34,13 +41,31 @@ alias fonts="/home/$USER/.local/share/fonts"
alias listfonts="fc-list :scalable=true:spacing=mono: family"
alias cachefonts="fc-cache -f -v"
alias c="clear"
alias v="vim"
alias w="vim ~/vimwiki/index.md"
# change cursor thickness for vi-mode
function zle-keymap-select {
if [[ ${KEYMAP} == vicmd ]] ||
[[ $1 = 'block' ]]; then
echo -ne '\e[1 q'
elif [[ ${KEYMAP} == main ]] ||
[[ ${KEYMAP} == viins ]] ||
[[ ${KEYMAP} = '' ]] ||
[[ $1 = 'beam' ]]; then
echo -ne '\e[6 q'
fi
}
zle -N zle-keymap-select
_fix_cursor() {
echo -ne '\e[6 q'
}
precmd_functions+=(_fix_cursor)
# fzf
export FZF_DEFAULT_OPTS='--height 40% --preview="head {}" --layout=reverse --bind "enter:execute(vim {})" --bind "tab:down" --bind "btab:up"'
export FZF_DEFAULT_OPTS='--preview="head {}" --layout=reverse'
# Allow local aliases
if [ -f ~/.zshrc_local ]; then