mirror of
https://github.com/sahinakkaya/dotfiles.git
synced 2024-12-23 07:39:36 +01:00
Add initial versions of dotfiles
This commit is contained in:
parent
a184fc0cfd
commit
887eef0bba
131
.tmux.conf
Normal file
131
.tmux.conf
Normal file
@ -0,0 +1,131 @@
|
||||
# remap prefix to Control + Space
|
||||
set -g prefix C-Space
|
||||
bind C-Space send-prefix
|
||||
unbind C-b
|
||||
|
||||
|
||||
# Smart pane switching with awareness of Vim splits.
|
||||
# See: https://github.com/christoomey/vim-tmux-navigator
|
||||
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
||||
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
|
||||
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
|
||||
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
|
||||
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
|
||||
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
|
||||
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
|
||||
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
|
||||
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
|
||||
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
|
||||
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
|
||||
|
||||
|
||||
bind-key -T copy-mode-vi 'C-h' select-pane -L
|
||||
bind-key -T copy-mode-vi 'C-j' select-pane -D
|
||||
bind-key -T copy-mode-vi 'C-k' select-pane -U
|
||||
bind-key -T copy-mode-vi 'C-l' select-pane -R
|
||||
|
||||
# vim like copy mode
|
||||
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
||||
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
|
||||
|
||||
setw -g mode-keys vi
|
||||
|
||||
# Mouse support - set to on if you want to use the mouse
|
||||
setw -g mouse on
|
||||
|
||||
# source the .tmux.conf file with prefix + r
|
||||
bind r source-file ~/.tmux.conf \; display "Configuration Reloaded!"
|
||||
|
||||
bind-key - split-window -v
|
||||
bind-key '\' split-window -h
|
||||
bind-key _ split-window -fv
|
||||
bind-key | split-window -fh
|
||||
|
||||
|
||||
# set -g lock-after-time 300
|
||||
# set -g lock-command "asciiquarium"
|
||||
|
||||
# bind-key "'" choose-window
|
||||
# bind-key '"' choose-session
|
||||
# kill current pane/window
|
||||
bind-key q confirm-before kill-pane
|
||||
bind-key Q confirm-before kill-window
|
||||
bind-key C-q confirm-before kill-pane
|
||||
|
||||
# no prefix, just c-x
|
||||
bind -n C-x setw synchronize-panes
|
||||
|
||||
# reorder windows
|
||||
bind-key -n C-S-Left swap-window -t -1\; select-window -t -1
|
||||
bind-key -n C-S-Right swap-window -t +1\; select-window -t +1
|
||||
|
||||
set -g default-terminal "xterm-256color"
|
||||
|
||||
# start session number from 1 rather than 0
|
||||
# set -g base-index 1
|
||||
|
||||
# start pane number from 1 similar to windows
|
||||
# setw -g pane-base-index 1
|
||||
|
||||
|
||||
# highlight active pane
|
||||
# set -g window-style 'fg=colour247,bg=colour236'
|
||||
# set -g window-active-style 'fg=colour250,bg=black'
|
||||
# set-option -g pane-active-border-style fg=red
|
||||
|
||||
# use <prefix> C-l to clear screen
|
||||
bind C-l send-keys 'C-l'
|
||||
|
||||
# use <prefix> j for zooming the current pane
|
||||
bind-key j resize-pane -Z
|
||||
bind-key C-j resize-pane -Z
|
||||
|
||||
unbind z
|
||||
|
||||
# status bar theme
|
||||
set -g status 'on'
|
||||
set -g status-bg 'colour235'
|
||||
set -g status-justify 'centre'
|
||||
set -g status-style 'none'
|
||||
set -g status-left-style 'none'
|
||||
set -g status-left-length '100'
|
||||
set -g status-right-style 'none'
|
||||
set -g status-right-length '100'
|
||||
set -g message-command-style fg='colour222',bg='colour238'
|
||||
set -g message-style bg='colour238',fg='colour222'
|
||||
set -g pane-active-border-style fg='colour154'
|
||||
set -g pane-border-style fg='colour238'
|
||||
setw -g window-status-style fg='colour121',bg='colour235','none'
|
||||
setw -g window-status-activity-style bg='colour235',fg='colour154','none'
|
||||
setw -g window-status-separator ''
|
||||
set -g status-left '#[fg=colour232,bg=colour154] #S #[fg=colour154,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #W #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics] #[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]'
|
||||
# above status + whoami and uptime
|
||||
# set -g status-left '#[fg=colour232,bg=colour154] #S #[fg=colour154,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #W #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour121,bg=colour235] #(whoami) #(uptime | cut -d " " -f 1,2,3) #[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]'
|
||||
set -g status-right '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour121,bg=colour235] %R %a %h-%d #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #{battery_color_charge_fg}#[bg=colour238]#{battery_icon} #{battery_percentage}#[fg=colour154,bg=colour238,nobold,nounderscore,noitalics] #{prefix_highlight}'
|
||||
|
||||
setw -g window-status-format '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[default] #I #W #[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]'
|
||||
setw -g window-status-current-format '#[fg=colour235,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #I #W #F #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]'
|
||||
|
||||
# Plugin Customizations
|
||||
|
||||
set -g @prefix_highlight_fg 'colour232' # default is 'colour231'
|
||||
set -g @prefix_highlight_bg 'colour154' # default is 'colour04'
|
||||
set -g @prefix_highlight_sync_mode_attr 'fg=colour21,bg=colour154' # default is 'fg=default,bg=yellow'
|
||||
set -g @prefix_highlight_copy_mode_attr 'fg=colour160,bg=colour154' # default is 'fg=default,bg=yellow'
|
||||
set -g @prefix_highlight_show_copy_mode 'on'
|
||||
set -g @prefix_highlight_show_sync_mode 'on'
|
||||
set -g @prefix_highlight_sync_prompt 'SYNC'
|
||||
|
||||
set -g @resurrect-strategy-vim 'session'
|
||||
set -g @batt_icon_status_charging '⚡'
|
||||
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||
set -g @plugin 'tmux-plugins/tmux-continuum'
|
||||
set -g @plugin 'tmux-plugins/tmux-open'
|
||||
set -g @plugin 'tmux-plugins/tmux-yank'
|
||||
set -g @plugin 'tmux-plugins/tmux-copycat'
|
||||
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
|
||||
set -g @plugin 'tmux-plugins/tmux-battery'
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
317
.vimrc
Normal file
317
.vimrc
Normal file
@ -0,0 +1,317 @@
|
||||
" marks in this file
|
||||
" p -> plugins
|
||||
" s -> custom set's
|
||||
set nocompatible " be iMproved, required
|
||||
filetype off " required
|
||||
set number
|
||||
set path+=**
|
||||
set clipboard=unnamedplus
|
||||
set encoding=UTF-8
|
||||
let mapleader = "\<Space>"
|
||||
set relativenumber
|
||||
set incsearch
|
||||
set tabstop=4
|
||||
set updatetime=100
|
||||
" when indenting with '>', use 4 spaces width
|
||||
set shiftwidth=4
|
||||
" On pressing tab, insert 4 spaces
|
||||
set expandtab
|
||||
|
||||
set foldmethod=indent
|
||||
set foldlevel=99
|
||||
|
||||
set ic " ignore case while searching
|
||||
set smartcase " ignore case if search pattern is lower case
|
||||
" case-sensitive otherwise
|
||||
"
|
||||
set scrolloff=2
|
||||
|
||||
set mouse+=a
|
||||
" if &term =~ '^xterm'
|
||||
" tmux knows the extended mouse mode
|
||||
set ttymouse=xterm2
|
||||
" endif
|
||||
|
||||
|
||||
"toggle comment with //
|
||||
nmap // gcc
|
||||
vmap // gc
|
||||
|
||||
|
||||
" Toggle relative line number
|
||||
nmap <C-B><C-B> :set invrelativenumber<CR>
|
||||
|
||||
nmap gd :YcmCompleter GoToDefinition<CR>
|
||||
nnoremap <leader>ghw :h <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-m> :MaximizerToggle<CR>
|
||||
inoremap kj <esc>
|
||||
" Make Y consistent with C and D. See :help Y.
|
||||
nnoremap Y y$
|
||||
|
||||
|
||||
" Disable quote concealing in JSON files
|
||||
let g:vim_json_conceal=0
|
||||
|
||||
|
||||
let g:sneak#label = 1
|
||||
let g:loaded_matchparen=1
|
||||
|
||||
" Start interactive EasyAlign in visual mode (e.g. vipga)
|
||||
xmap ga <Plug>(EasyAlign)
|
||||
|
||||
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
|
||||
nmap ga <Plug>(EasyAlign)
|
||||
" set the runtime path to include Vundle and initialize
|
||||
set rtp+=~/.vim/bundle/Vundle.vim
|
||||
" show cursorline only in active buffer
|
||||
|
||||
"keybindings for quickly switching windows
|
||||
" nnoremap <C-J> <C-W>j
|
||||
" nnoremap <C-K> <C-W>k
|
||||
" nnoremap <C-L> <C-W>l
|
||||
" nnoremap <C-H> <C-W>h
|
||||
|
||||
augroup CursorLine
|
||||
au!
|
||||
au VimEnter,WinEnter,BufWinEnter * setlocal cursorline
|
||||
au WinLeave * setlocal nocursorline
|
||||
augroup END
|
||||
|
||||
|
||||
" toggle search with f3
|
||||
nnoremap <F3> :nohlsearch<CR>
|
||||
"trigger fzf with ctrl+f
|
||||
nnoremap <silent> <C-f> :Files<CR>
|
||||
"fzf but for git files.
|
||||
silent! nmap <C-P> :GFiles<CR>
|
||||
let g:fzf_colors = {
|
||||
\ 'fg': ['fg', 'GruvboxGray'],
|
||||
\ 'bg': ['bg', 'Normal'],
|
||||
\ 'hl': ['fg', 'GruvboxRed'],
|
||||
\ 'fg+': ['fg', 'GruvboxGreen'],
|
||||
\ 'bg+': ['bg', 'GruvboxBg1'],
|
||||
\ 'hl+': ['fg', 'GruvboxRed'],
|
||||
\ 'info': ['fg', 'GruvboxOrange'],
|
||||
\ 'prompt': ['fg', 'GruvboxBlue'],
|
||||
\ 'header': ['fg', 'GruvboxBlue'],
|
||||
\ 'pointer': ['fg', 'Error'],
|
||||
\ 'marker': ['fg', 'Error'],
|
||||
\ 'spinner': ['fg', 'Statement'],
|
||||
\ }
|
||||
let g:fzf_layout = {'window': {'width': 0.8, 'height': 0.8} }
|
||||
let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -l'
|
||||
let $FZF_DEFAULT_OPTS='--reverse --bind change:top'
|
||||
" Quickly insert an empty new line without entering insert mode
|
||||
"nnoremap <Leader>o o<Esc>
|
||||
"nnoremap <Leader>O O<Esc>
|
||||
|
||||
|
||||
set t_Co=256
|
||||
call vundle#begin()
|
||||
|
||||
Plugin 'airblade/vim-gitgutter'
|
||||
Plugin 'altercation/vim-colors-solarized'
|
||||
"Plugin 'ctrlpvim/ctrlp.vim'
|
||||
Plugin 'christoomey/vim-tmux-navigator'
|
||||
Plugin 'dense-analysis/ale'
|
||||
"Plugin 'ErichDonGubler/vim-sublime-monokai'
|
||||
Plugin 'flazz/vim-colorschemes'
|
||||
"Plugin 'git://git.wincent.com/command-t.git'
|
||||
Plugin 'gko/vim-coloresque'
|
||||
Plugin 'gruvbox-community/gruvbox'
|
||||
Plugin 'haya14busa/incsearch.vim'
|
||||
Plugin 'junegunn/vim-easy-align'
|
||||
Plugin 'justinmk/vim-sneak'
|
||||
Plugin 'kana/vim-textobj-line'
|
||||
Plugin 'kana/vim-textobj-user'
|
||||
Plugin 'lepture/vim-jinja'
|
||||
Plugin 'liuchengxu/vim-which-key'
|
||||
"rainbow parenthesis
|
||||
Plugin 'luochen1990/rainbow'
|
||||
Plugin 'mbbill/undotree'
|
||||
"muti cursor vim
|
||||
Plugin 'mg979/vim-visual-multi'
|
||||
Plugin 'mhinz/vim-startify'
|
||||
" -------------------------------------look at this
|
||||
Plugin 'patstockwell/vim-monokai-tasty'
|
||||
"Plugin 'preservim/nerdcommenter'
|
||||
Plugin 'preservim/nerdtree'
|
||||
"Plugin 'preservim/syntastic' ----------- look at this
|
||||
Plugin 'puremourning/vimspector'
|
||||
Plugin 'stsewd/fzf-checkout.vim'
|
||||
Plugin 'szw/vim-maximizer'
|
||||
"Plugin 'rafi/awesome-vim-colorschemes'
|
||||
" The sparkup vim script is in a subdirectory of this repo called vim.
|
||||
" Pass the path to set the runtimepath properly.
|
||||
"write html code faster
|
||||
"Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
|
||||
Plugin 'ryanoasis/vim-devicons'
|
||||
" foldign for python
|
||||
"Plugin 'tmhedberg/SimpylFold'
|
||||
"desparate
|
||||
"desperate
|
||||
"
|
||||
Plugin 'tpope/vim-abolish'
|
||||
Plugin 'tpope/vim-fugitive'
|
||||
Plugin 'tpope/vim-obsession'
|
||||
Plugin 'tpope/vim-repeat'
|
||||
Plugin 'tpope/vim-surround'
|
||||
Plugin 'tpope/vim-unimpaired'
|
||||
Plugin 'tpope/vim-rhubarb'
|
||||
Plugin 'tomtom/tcomment_vim'
|
||||
Plugin 'vim-airline/vim-airline'
|
||||
Plugin 'vim-airline/vim-airline-themes'
|
||||
Plugin 'vim-scripts/indentpython.vim'
|
||||
Plugin 'VundleVim/Vundle.vim'
|
||||
"Plugin 'xuyuanp/nerdtree git-plugin'
|
||||
Plugin 'ycm-core/YouCompleteMe'
|
||||
Plugin 'Yggdroot/indentLine'
|
||||
call vundle#end() " required
|
||||
call plug#begin()
|
||||
"Plug 'luochen1990/rainbow'
|
||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
call plug#end()
|
||||
|
||||
let g:ale_fixers = {
|
||||
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
|
||||
\ 'python': [
|
||||
\ 'add_blank_lines_for_python_control_statements',
|
||||
\ 'black',
|
||||
\ 'isort',
|
||||
\ ],
|
||||
\ 'json': [
|
||||
\ 'fixjson' ,
|
||||
\ ],
|
||||
\ 'jinja.html': ['tidy'],
|
||||
\}
|
||||
|
||||
let g:ale_fix_on_save = 1
|
||||
|
||||
source $HOME/.which-key.vim
|
||||
" source $HOME/rotate.vim
|
||||
nmap <silent> <C-e> <Plug>(ale_next_wrap)
|
||||
|
||||
" Disable tmux navigator when zooming the Vim pane
|
||||
let g:tmux_navigator_disable_when_zoomed = 1
|
||||
|
||||
set backup " keep a backup file (restore to previous version)
|
||||
set swapfile
|
||||
set dir=~/.vim/tmp
|
||||
set undodir=~/.vim/undo
|
||||
set backupdir=~/.vim/backup
|
||||
if has('persistent_undo')
|
||||
set undofile " keep an undo file (undo changes after closing)
|
||||
endif
|
||||
|
||||
let g:gruvbox_italic=1
|
||||
set background=dark
|
||||
colorscheme gruvbox
|
||||
|
||||
filetype plugin indent on
|
||||
" show existing tab with 4 spaces width
|
||||
augroup vimrcEx
|
||||
au!
|
||||
" For all text files set 'textwidth' to 78 characters.
|
||||
autocmd FileType text setlocal textwidth=78
|
||||
augroup END
|
||||
|
||||
|
||||
" Add optional packages.
|
||||
"
|
||||
" The matchit plugin makes the % command work better, but it is not backwards
|
||||
" compatible.
|
||||
" The ! means the package won't be loaded right away but when plugins are
|
||||
" loaded during initialization.
|
||||
if has('syntax') && has('eval')
|
||||
packadd! matchit
|
||||
endif
|
||||
|
||||
"automatically start nerdtree when vim is opened
|
||||
"autocmd vimenter * NERDTree
|
||||
"ignore some files and dirs in nerdtree
|
||||
let NERDTreeIgnore = ['\.py[cod]$', '\.egg$', '\.o$', '\~$', '__pycache__$', '\.egg-info$', 'node_modules$']
|
||||
let NERDTreeDirArrowExpandable = "\u00a0" " make arrows invisible
|
||||
let NERDTreeDirArrowCollapsible = "\u00a0" " make arrows invisible
|
||||
let g:NERDTreeMapJumpNextSibling = '<Nop>'
|
||||
let g:NERDTreeMapJumpPrevSibling = '<Nop>'
|
||||
|
||||
|
||||
"exclude files and directories using Vim's wildignore
|
||||
set wildmenu
|
||||
set wildmode=longest,list
|
||||
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
|
||||
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows
|
||||
set wildignore+=*.pyc
|
||||
set wildignore+=*_build/*
|
||||
set wildignore+=**/coverage/*
|
||||
set wildignore+=**/node_modules/*
|
||||
set wildignore+=**/android/*
|
||||
set wildignore+=**/ios/*
|
||||
set wildignore+=**/.git/*
|
||||
|
||||
|
||||
|
||||
|
||||
let g:ycm_autoclose_preview_window_after_insertion = 1
|
||||
let g:ycm_autoclose_preview_window_after_completion = 1
|
||||
let g:ycm_always_populate_location_list = 1
|
||||
let g:ycm_key_detailed_diagnostics = ''
|
||||
|
||||
let g:indentLine_concealcursor = 'inc'
|
||||
let g:indentLine_conceallevel = 2
|
||||
|
||||
let g:airline_powerline_fonts = 1
|
||||
let g:airline_theme='deus'
|
||||
let g:airline#extensions#tabline#enabled = 1 " Use the airline tabline (replacement for buftabline)
|
||||
let g:airline#extensions#tabline#show_buffers = 0
|
||||
let g:airline#extensions#tabline#show_splits = 0
|
||||
let g:airline#extensions#tabline#show_tabs = 1
|
||||
let g:airline#extensions#tabline#show_tab_nr = 0
|
||||
let g:airline#extensions#tabline#show_tab_type = 0
|
||||
let g:airline#extensions#tabline#close_symbol = '×'
|
||||
let g:airline#extensions#tabline#show_close_button = 0
|
||||
let g:airline#extensions#obsession#enabled = 1
|
||||
let g:airline#extensions#obsession#indicator_text = '|🔴 REC|'
|
||||
" let g:airline#extensions#obsession#indicator_text = '<✏️ >'
|
||||
|
||||
let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle
|
||||
"let g:ale_sign_warning = '⚠️⚠️'
|
||||
" let g:ale_sign_error = "◉"
|
||||
let g:ale_sign_warning = " ◉"
|
||||
let g:ale_sign_error = ' ✗'
|
||||
" let g:ale_sign_error = '•'
|
||||
" let g:ale_sign_warning = '•'
|
||||
highlight clear SignColumn
|
||||
highlight ALEErrorSign ctermfg=196 guifg=#C30500
|
||||
highlight ALEWarningSign ctermfg=214 guifg=#ED6237
|
||||
|
||||
" git gutter
|
||||
let g:gitgutter_sign_added = '▌'
|
||||
let g:gitgutter_sign_modified = '▌'
|
||||
let g:gitgutter_sign_removed = '▁'
|
||||
let g:gitgutter_sign_removed_first_line = '▌'
|
||||
let g:gitgutter_sign_modified_removed = '▌'
|
||||
let g:gitgutter_map_keys = 1
|
||||
let g:gitgutter_realtime = 1
|
||||
let g:gitgutter_preview_win_floating = 1
|
||||
nmap ]h <Plug>(GitGutterNextHunk)
|
||||
nmap [h <Plug>(GitGutterPrevHunk)
|
||||
highlight GitutterDelete guifg=#F97CA9
|
||||
highlight GitGutterAdd guifg=#BEE275
|
||||
highlight GitGutterChange guifg=#96E1EF
|
||||
highlight GitGutterAdd guifg=#009900 ctermfg=2
|
||||
highlight GitGutterChange ctermfg=3
|
||||
highlight GitGutterDelete ctermfg=1
|
||||
highlight GitGutterChangeDelete ctermfg=4
|
||||
|
||||
" vimspector
|
||||
let g:vimspector_enable_mappings = 'HUMAN'
|
||||
" packadd! vimspector
|
||||
nnoremap <leader>dd :call vimspector#Launch()<CR>
|
||||
let g:which_key_map.d.d = 'launch debugging'
|
||||
|
||||
" incsearch
|
||||
map / <Plug>(incsearch-forward)
|
||||
map ? <Plug>(incsearch-backward)
|
||||
map g/ <Plug>(incsearch-stay)
|
165
.which-key.vim
Normal file
165
.which-key.vim
Normal file
@ -0,0 +1,165 @@
|
||||
" Map leader to which_key
|
||||
nnoremap <silent> <leader> :silent WhichKey '<Space>'<CR>
|
||||
vnoremap <silent> <leader> :silent <c-u> :silent WhichKeyVisual '<Space>'<CR>
|
||||
|
||||
" Create map to add keys to
|
||||
let g:which_key_map = {}
|
||||
" Define a separator
|
||||
let g:which_key_sep = '→'
|
||||
set timeoutlen=500
|
||||
|
||||
|
||||
" Not a fan of floating windows for this
|
||||
let g:which_key_use_floating_win = 0
|
||||
|
||||
" Change the colors if you want
|
||||
highlight default link WhichKey Operator
|
||||
highlight default link WhichKeySeperator DiffAdded
|
||||
highlight default link WhichKeyGroup Identifier
|
||||
highlight default link WhichKeyDesc Function
|
||||
|
||||
" Hide status line
|
||||
autocmd! FileType which_key
|
||||
autocmd FileType which_key set laststatus=0 noshowmode noruler
|
||||
\| autocmd BufLeave <buffer> set laststatus=2 noshowmode ruler
|
||||
|
||||
" Single mappings
|
||||
let g:which_key_map['e'] = [ ':e $MYVIMRC', 'Edit .vimrc' ]
|
||||
let g:which_key_map['w'] = [ ':e ~/.which-key.vim', 'Edit .which-key.vim' ]
|
||||
let g:which_key_map['.'] = [ ':source $MYVIMRC', 'Source .vimrc' ]
|
||||
let g:which_key_map["'"] = [ ':NERDTreeToggle', 'NerdTree' ]
|
||||
let g:which_key_map['f'] = [ ':Files', 'search files' ]
|
||||
let g:which_key_map['-'] = [ ':new', 'hsplit']
|
||||
let g:which_key_map['n'] = [ ':Startify', 'start screen' ]
|
||||
let g:which_key_map['T'] = [ ':Rg', 'search text' ]
|
||||
let g:which_key_map['\'] = [ ':vnew', 'vsplit']
|
||||
let g:which_key_map['j'] = [':tabprevious', 'previos tab']
|
||||
let g:which_key_map['k'] = [':tabnext', 'next tab']
|
||||
let g:which_key_map['='] = ['<C-W>=', 'balance windows']
|
||||
let g:which_key_map['u'] = [':UndotreeToggle', 'toggle undo tree']
|
||||
let g:which_key_map['a'] = ['<C-^>', 'alternate file']
|
||||
|
||||
|
||||
" let g:which_key_map['z'] = [ 'Goyo' , 'zen' ]
|
||||
|
||||
" r is for resize
|
||||
let g:which_key_map.r = {
|
||||
\ 'name' : '+Resize-windows',
|
||||
\ 'l' : [':vertical resize +5', 'increase width'],
|
||||
\ 'h' : [':vertical resize -5', 'decrease width'],
|
||||
\ 'k' : [':resize +5', 'increase height'],
|
||||
\ 'j' : [':resize -5', 'decrease height'],
|
||||
\ '=' : ['<C-W>=', 'equalize width and height'],
|
||||
\ 'w' : ['<C-W>|', 'set max width'],
|
||||
\ 'e' : ['<C-W>_', 'set max height'],
|
||||
\ 'm' : [':MaximizerToggle', 'toggle maximize'],
|
||||
\ }
|
||||
|
||||
" d is for debug
|
||||
let g:which_key_map.d = {
|
||||
\ 'name' : '+Debug',
|
||||
\ 'e' : [':call vimspector#Reset()', 'exit debug mode'],
|
||||
\ 'l' : [':call vimspector#StepInto()', 'step into'],
|
||||
\ 'j' : [':call vimspector#StepOver()', 'step over'],
|
||||
\ 'k' : [':call vimspector#StepOut()', 'step out'],
|
||||
\ 'r' : [':call vimspector#Restart()', 'restart debugging'],
|
||||
\ 'c' : [':call vimspector#Continue()', 'continue'],
|
||||
\ 'rc' : [':call vimspector#RunToCursor()', 'run to cursor'],
|
||||
\ }
|
||||
" \ 'c' : [':call GoToWindow(g:vimspector_session_windows.code)', 'focus on code'],
|
||||
" \ 't' : [':call GotoWindow(g:vimspector_session_windows.tagpage)', ''],
|
||||
" \ 'v' : [':call GotoWindow(g:vimspector_session_windows.variables)', ''],
|
||||
" \ 'w' : [':call GotoWindow(g:vimspector_session_windows.watches)', ''],
|
||||
" \ 's' : [':call GotoWindow(g:vimspector_session_windows.stack_trace)', ''],
|
||||
" \ 'o' : [':call GotoWindow(g:vimspector_session_windows.output)', ''],
|
||||
|
||||
let g:which_key_map.d.b = {
|
||||
\ 'p' : [':call vimspector#ToggleBreakPoint()', 'toggle breakpoint'],
|
||||
\}
|
||||
|
||||
" s is for search
|
||||
let g:which_key_map.s = {
|
||||
\ 'name' : '+search',
|
||||
\ '/' : [':History/', 'history'],
|
||||
\ ';' : [':Commands', 'commands'],
|
||||
\ 'a' : [':Ag', 'text Ag'],
|
||||
\ 'b' : [':BLines', 'current buffer'],
|
||||
\ 'B' : [':Buffers', 'open buffers'],
|
||||
\ 'c' : [':Commits', 'commits'],
|
||||
\ 'C' : [':BCommits', 'buffer commits'],
|
||||
\ 'f' : [':Files', 'files'],
|
||||
\ 'g' : [':GFiles', 'git files'],
|
||||
\ 'G' : [':GFiles?', 'modified git files'],
|
||||
\ 'h' : [':History', 'file history'],
|
||||
\ 'H' : [':History:', 'command history'],
|
||||
\ 'l' : [':Lines', 'lines'],
|
||||
\ 'm' : [':Marks', 'marks'],
|
||||
\ 'M' : [':Maps', 'normal maps'],
|
||||
\ 'p' : [':Helptags', 'help tags'],
|
||||
\ 'P' : [':Tags', 'project tags'],
|
||||
\ 's' : [':Snippets', 'snippets'],
|
||||
\ 'S' : [':Colors', 'color schemes'],
|
||||
\ 't' : [':Rg', 'text Rg'],
|
||||
\ 'T' : [':BTags', 'buffer tags'],
|
||||
\ 'w' : [':Windows', 'search windows'],
|
||||
\ 'y' : [':Filetypes', 'file types'],
|
||||
\ 'z' : [':FZF', 'FZF'],
|
||||
\ }
|
||||
|
||||
" S is for Session
|
||||
let g:which_key_map.S = {
|
||||
\ 'name' : '+Session',
|
||||
\ 's' : [':mksession!', 'save session'],
|
||||
\ 'r' : [':source Session.vim', 'restore session'],
|
||||
\ }
|
||||
|
||||
" t is for tabs
|
||||
let g:which_key_map.t = {
|
||||
\ 'name' : '+Tab',
|
||||
\ 'n' : [':tabnew', 'new tab'],
|
||||
\ 'c' : [':tabclose', 'close tab'],
|
||||
\ 'C' : [':tabonly', 'close every other tab'],
|
||||
\ 'j' : [':tabprevious', 'previos tab'],
|
||||
\ 'k' : [':tabnext', 'next tab'],
|
||||
\ 'h' : [':tabmove 0', 'move to beginning'],
|
||||
\ ',' : [':tabmove -1', 'move left'],
|
||||
\ '.' : [':tabmove +1', 'move right'],
|
||||
\ 'l' : [':tabmove $', 'move to end'],
|
||||
\ }
|
||||
|
||||
" g is for git
|
||||
let g:which_key_map.g = {
|
||||
\ 'name' : '+git',
|
||||
\ 'B' : [':GBrowse', 'view in browser'],
|
||||
\ 'd' : [':Git diff', 'diff'],
|
||||
\ 'D' : [':Git diff --staged', 'diff staged'],
|
||||
\ 'c' : [':GBranches', 'checkout'],
|
||||
\ 'g' : [':G', 'summary'],
|
||||
\ 'f' : [':GitGutterFold', 'fold'],
|
||||
\ 'j' : [':GitGutterNextHunk', 'next hunk'],
|
||||
\ 'k' : [':GitGutterPrevHunk', 'prev hunk'],
|
||||
\ 'a' : [':diffget //3', 'diffget from left'],
|
||||
\ ';' : [':diffget //2', 'diffget from right'],
|
||||
\ 'l' : [':Commits', 'pretty logs'],
|
||||
\ 'L' : [':Git log', 'log'],
|
||||
\ 'p' : [':GitGutterPreviewHunk', 'preview hunk'],
|
||||
\ 's' : [':GitGutterStageHunk', 'stage hunk'],
|
||||
\ 'S' : [':Gstatus', 'status'],
|
||||
\ 'u' : [':GitGutterUndoHunk', 'undo hunk'],
|
||||
\ }
|
||||
|
||||
" " b is for buffer
|
||||
" let g:which_key_map.b = {
|
||||
" \ 'name' : '+buffer',
|
||||
" \ 'n' : [':bnext', 'next-buffer'],
|
||||
" \ 'p' : [':bprevious', 'previous-buffer'],
|
||||
" \ '?' : [':Buffers', 'fzf-buffer'],
|
||||
" \ }
|
||||
" \ '>' : [':BufferMoveNext', 'move next'],
|
||||
" \ '<' : [':BufferMovePrevious', 'move prev'],
|
||||
" \ 'b' : [':BufferPick', 'pick buffer'],
|
||||
" \ 'd' : [':BufferClose', 'delete-buffer'],
|
||||
"
|
||||
|
||||
" Register which key map
|
||||
call which_key#register('<Space>', "g:which_key_map")
|
201
.zshrc
Normal file
201
.zshrc
Normal file
@ -0,0 +1,201 @@
|
||||
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
||||
# Initialization code that may require console input (password prompts, [y/n]
|
||||
# confirmations, etc.) must go above this block, everything else may go below.
|
||||
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||
fi
|
||||
|
||||
# secret environment variables goes in /etc/environment
|
||||
# sudoedit /etc/environment
|
||||
|
||||
# If you come from bash you might have to change your $PATH.
|
||||
# export PATH=$HOME/bin:/usr/local/bin:$PATH
|
||||
# Path to your oh-my-zsh installation.
|
||||
# export TERM="xterm-256color"
|
||||
export ZSH="$HOME/.oh-my-zsh"
|
||||
|
||||
# Set name of the theme to load --- if set to "random", it will
|
||||
# load a random theme each time oh-my-zsh is loaded, in which case,
|
||||
# to know which specific one was loaded, run: echo $RANDOM_THEME
|
||||
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
|
||||
|
||||
POWERLEVEL9K_MODE='nerdfont-complete'
|
||||
ZSH_THEME="powerlevel10k/powerlevel10k"
|
||||
#ZSH_THEME="robbyrussell"
|
||||
|
||||
|
||||
# Set list of themes to pick from when loading at random
|
||||
# Setting this variable when ZSH_THEME=random will cause zsh to load
|
||||
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
|
||||
# If set to an empty array, this variable will have no effect.
|
||||
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
|
||||
|
||||
# Uncomment the following line to use case-sensitive completion.
|
||||
# CASE_SENSITIVE="true"
|
||||
|
||||
# Uncomment the following line to use hyphen-insensitive completion.
|
||||
# Case-sensitive completion must be off. _ and - will be interchangeable.
|
||||
# HYPHEN_INSENSITIVE="true"
|
||||
|
||||
# Uncomment the following line to disable bi-weekly auto-update checks.
|
||||
# DISABLE_AUTO_UPDATE="true"
|
||||
|
||||
# Uncomment the following line to change how often to auto-update (in days).
|
||||
# export UPDATE_ZSH_DAYS=13
|
||||
|
||||
# Uncomment the following line to disable colors in ls.
|
||||
# DISABLE_LS_COLORS="true"
|
||||
|
||||
# Uncomment the following line to disable auto-setting terminal title.
|
||||
# DISABLE_AUTO_TITLE="true"
|
||||
|
||||
# Uncomment the following line to enable command auto-correction.
|
||||
ENABLE_CORRECTION="true"
|
||||
|
||||
# Uncomment the following line to display red dots whilst waiting for completion.
|
||||
COMPLETION_WAITING_DOTS="true"
|
||||
|
||||
# Uncomment the following line if you want to disable marking untracked files
|
||||
# under VCS as dirty. This makes repository status check for large repositories
|
||||
# much, much faster.
|
||||
# DISABLE_UNTRACKED_FILES_DIRTY="true"
|
||||
|
||||
# Uncomment the following line if you want to change the command execution time
|
||||
# stamp shown in the history command output.
|
||||
# You can set one of the optional three formats:
|
||||
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
|
||||
# or set a custom format using the strftime function format specifications,
|
||||
# see 'man strftime' for details.
|
||||
# HIST_STAMPS="mm/dd/yyyy"
|
||||
|
||||
# Would you like to use another custom folder than $ZSH/custom?
|
||||
# ZSH_CUSTOM=/path/to/new-custom-folder
|
||||
|
||||
# Which plugins would you like to load?
|
||||
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
|
||||
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
|
||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||
# Add wisely, as too many plugins slow down shell startup.
|
||||
|
||||
plugins=(
|
||||
zsh-autosuggestions python pip last-working-dir history sudo command-not-found git poetry extract zsh-syntax-highlighting docker docker-compose zsh-vi-mode z.lua
|
||||
)
|
||||
|
||||
# plugins=(
|
||||
# zsh-autosuggestions python pip last-working-dir history dirhistory sudo web-search command-not-found git poetry extract zsh-syntax-highlighting docker docker-compose zsh-vi-mode z.lua
|
||||
# )
|
||||
#
|
||||
|
||||
ZVM_VI_INSERT_ESCAPE_BINDKEY=kj
|
||||
ZVM_LAZY_KEYBINDINGS=false
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
||||
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=32'
|
||||
# User configuration
|
||||
|
||||
# export MANPATH="/usr/local/man:$MANPATH"
|
||||
|
||||
# You may need to manually set your language environment
|
||||
export LANG=en_US.UTF-8
|
||||
|
||||
# Preferred editor for local and remote sessions
|
||||
# if [[ -n $SSH_CONNECTION ]]; then
|
||||
# export EDITOR='vim'
|
||||
# else
|
||||
# export EDITOR='mvim'
|
||||
# fi
|
||||
|
||||
# Compilation flags
|
||||
# export ARCHFLAGS="-arch x86_64"
|
||||
|
||||
# ssh
|
||||
# export SSH_KEY_PATH="~/.ssh/rsa_id"
|
||||
|
||||
# Set personal aliases, overriding those provided by oh-my-zsh libs,
|
||||
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
|
||||
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
|
||||
# For a full list of active aliases, run `alias`.
|
||||
|
||||
alias rake='noglob bundled_rake'
|
||||
eval $(thefuck --alias)
|
||||
unsetopt nomatch
|
||||
alias weather='curl wttr.in/?0'
|
||||
alias gdm='gd master'
|
||||
alias ratslap="~/Downloads/ratslap/ratslap"
|
||||
alias charmce="/usr/local/bin/charmce"
|
||||
alias intel="sudo prime-select intel"
|
||||
alias nvidia="sudo prime-select nvidia"
|
||||
alias pls="sudo"
|
||||
alias p="charm ."
|
||||
alias cat="bat"
|
||||
alias bd="batdiff"
|
||||
alias man="batman"
|
||||
alias cd.="cd .."
|
||||
alias cd..="cd .."
|
||||
alias xd="xdg-open &>/dev/null"
|
||||
alias xd.="xdg-open &>/dev/null ."
|
||||
alias suod="sudo"
|
||||
alias sduo="sudo"
|
||||
alias zz='z -c' # restrict matches to subdirs of $PWD
|
||||
alias zi='z -I' # use fzf to select in multiple matches
|
||||
alias t="todo.sh"
|
||||
alias ta="todo.sh add"
|
||||
alias tl="todo.sh list"
|
||||
alias td="todo.sh do"
|
||||
alias tp="todo.sh pri"
|
||||
alias viz="vim ~/.zshrc"
|
||||
alias vit="vim ~/.tmux.conf"
|
||||
alias vip="vim ~/.p10k.zsh"
|
||||
alias viv="vim ~/.vimrc"
|
||||
alias viw="vim ~/.which-key.vim"
|
||||
alias dotfiles='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
|
||||
|
||||
|
||||
# . /usr/share/autojump/autojump.sh
|
||||
export PATH="$HOME/.poetry/bin:$PATH"
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
export PATH="/snap/bin:$PATH"
|
||||
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
|
||||
if command -v pyenv 1>/dev/null 2>&1; then
|
||||
eval "$(pyenv init -)"
|
||||
fi
|
||||
|
||||
eval "$(pyenv virtualenv-init -)"
|
||||
|
||||
|
||||
# If not in tmux session, add battery and time to prompt
|
||||
[[ -n $TMUX ]] || POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS+=(battery time)
|
||||
|
||||
export VISUAL=vim
|
||||
export EDITOR="$VISUAL"
|
||||
export PYTHONBREAKPOINT=ipdb.set_trace
|
||||
export ZSH_AUTOSUGGEST_USE_ASYNC=true
|
||||
|
||||
# https://github.com/jeffreytse/zsh-vi-mode#execute-extra-commands
|
||||
function my_bindings() {
|
||||
# easy bindings instead of ctrl + arrow keys
|
||||
bindkey '^j' backward-word
|
||||
bindkey '^f' forward-word
|
||||
bindkey '^g' autosuggest-accept
|
||||
bindkey "\e\e" sudo-command-line
|
||||
}
|
||||
|
||||
|
||||
zvm_after_init_commands+=('[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh')
|
||||
zvm_after_init_commands+=(my_bindings)
|
||||
# Always starting with insert mode for each command line
|
||||
ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT
|
||||
ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLOCK
|
||||
|
||||
export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -l -g ""'
|
||||
export FZF_DEFAULT_OPTS='--bind change:top'
|
||||
|
||||
# export TERM_ITALICS=false
|
||||
|
||||
autoload -U compinit; compinit -y
|
||||
|
||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
Loading…
Reference in New Issue
Block a user