Skip to content

Commit 9967974

Browse files
committed
Refactor vimrc
1 parent 8f0e77e commit 9967974

File tree

4 files changed

+84
-80
lines changed

4 files changed

+84
-80
lines changed

config/sxhkd/sxhkdrc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,11 @@ XF86AudioStop
152152

153153
#Print screen
154154
Print
155-
scrot ~/Pictures
155+
scrot -e 'mv $f ~/Pictures/screenshots'
156156
shift + @Print
157-
scrot -s ~/Pictures
158-
157+
scrot -s -e 'mv $f ~/Pictures/screenshots'
158+
alt + Print
159+
scrot -u -e 'mv $f ~/Pictures/screenshots'
159160
ctrl + Print
160161
scrot /tmp/screenshot-$(date +%F_%T).png -e 'xclip -selection c -t image/png < $f'
161162
ctrl + shift + @Print

tmux.conf.basic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ set -g status-left "#[fg=colour232,bg=green,bold] #S #[fg=green,bg=colour237,nob
1717
# Right side of status bar
1818
set -g status-right-style bg=black,fg=cyan
1919
set -g status-right-length 40
20-
set -g status-right "#H #[fg=white]« #[fg=yellow]%H:%M:%S #[fg=green]%d-%b-%y"
20+
set -g status-right "#H #[fg=white]« #[fg=green]%d-%b-%y"
2121

2222
# Window status
2323
set -g window-status-format " #I:#W#F "

vim/vimrc

Lines changed: 72 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,50 @@
11
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-
" General config "
2+
" Plugins "
3+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4+
call plug#begin('~/.vim/plugged')
5+
" Main plugin
6+
Plug 'ctrlpvim/ctrlp.vim'
7+
Plug 'mileszs/ack.vim'
8+
Plug 'neoclide/coc.nvim', {'branch': 'release'}
9+
Plug 'dense-analysis/ale'
10+
Plug 'scrooloose/nerdtree'
11+
Plug 'tpope/vim-fugitive'
12+
Plug 'junegunn/gv.vim'
13+
Plug 'tpope/vim-commentary'
14+
Plug 'tpope/vim-surround'
15+
Plug 'tpope/vim-repeat'
16+
Plug 'easymotion/vim-easymotion'
17+
Plug 'kana/vim-textobj-user'
18+
Plug 'christoomey/vim-tmux-navigator'
19+
" For Rails
20+
Plug 'vim-ruby/vim-ruby'
21+
Plug 'tpope/vim-rails'
22+
Plug 'neoclide/coc-solargraph', {'do': 'yarn install --frozen-lockfile'}
23+
Plug 'nelstrom/vim-textobj-rubyblock'
24+
Plug 'tpope/vim-endwise'
25+
" For Python
26+
Plug 'neoclide/coc-python', {'do': 'yarn install --frozen-lockfile'}
27+
" Frontend
28+
Plug 'pangloss/vim-javascript'
29+
Plug 'ap/vim-css-color'
30+
" UI
31+
Plug 'vim-airline/vim-airline'
32+
Plug 'morhetz/gruvbox'
33+
" other
34+
Plug 'suan/vim-instant-markdown', {'for': 'markdown'}
35+
call plug#end()
36+
37+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
38+
" General configs "
339
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
440
set encoding=UTF-8
541
set history=500
642
set mouse=a
7-
set autoread " Set to auto read when a file is changed from the outside
843
set noswapfile
9-
set clipboard=unnamed " Use the OS clipboard by default
1044
set backspace=indent,eol,start
1145
set whichwrap+=<,>,h,l
46+
set autoread " Set to auto read when a file is changed
47+
set clipboard=unnamed " Use the OS clipboard by default
1248
set hid " A buffer becomes hidden when it is abandoned
1349
filetype indent on " Enable filetype plugins
1450
filetype plugin on
@@ -19,53 +55,61 @@ set shiftwidth=2 " Number of auto-indent spaces
1955
set smartindent " Enable smart-indent
2056
set smarttab " Enable smart-tabs
2157
set softtabstop=2 " Number of spaces per Tab
22-
set splitbelow
23-
set splitright
58+
set foldmethod=indent " Fold based on indent
59+
set foldnestmax=5 " Deepest fold is 5 levels
60+
set nofoldenable " No fold when start
61+
set splitbelow " Split below
62+
set splitright " Split right
2463
set number relativenumber " turn hybrid line numbers on
2564
set cursorline " Highlight cursorline
2665
set hlsearch " Highlight all search results
2766
set smartcase " Enable smart-case search
2867
set ignorecase " Always case-insensitive
2968
set incsearch " Searches for strings incrementally
3069
set so=7 " Set 7 lines to the cursor
70+
set foldcolumn=1 " Add a bit extra margin to the left
3171
set laststatus=2
3272
set ruler
3373
set wildmenu
34-
set foldcolumn=1 " Add a bit extra margin to the left
35-
au FocusGained,BufEnter * checktime
74+
au FocusGained,BufEnter * :checktime
75+
76+
" Scheme
77+
colorscheme gruvbox
78+
let g:gruvbox_contrast_dark='hard'
79+
set background=dark
3680

3781
" Enable matchit for ruby textobject
3882
runtime macros/matchit.vim
3983

4084
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
41-
" Map key "
85+
" Mappings "
4286
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4387
map s <Nop>
44-
" let mapleader=","
45-
"let mapleader="s"
4688
let mapleader=" "
47-
:imap jk <Esc>
89+
imap jk <Esc>
90+
91+
vmap <C-C> "+y
92+
vmap gy "+y
93+
nmap gy "+y
94+
nmap gp "+p
4895
49-
" Map key yank and paste clipboard
50-
:vmap <C-C> "+y
51-
:vmap gy "+y
52-
:nmap gy "+y
53-
:nmap gp "+p
96+
nmap ]<space> o<esc>
97+
nmap [<space> O<esc>
5498
5599
" Turn off search highlight
56100
map <silent> <leader><cr> :noh<cr>
57101
58-
" Map leader split windows
102+
" Split windows
59103
map <leader>sv <C-W>v
60104
map <leader>ss <C-W>s
61105
62-
" Close the current buffer
106+
" Buffer
63107
map <leader>xx :Bclose<cr>:tabclose<cr>gT
64108
map <leader>xa :bufdo bd<cr>
65109
map <leader>n :bnext<cr>
66110
map <leader>p :bprevious<cr>
67111
68-
" Useful mappings for managing tabs
112+
" Mappings for managing tabs
69113
map <leader>tc :tabnew<cr>
70114
map <leader>tx :tabclose<cr>
71115
map <leader>tn :tabnext<cr>
@@ -88,54 +132,16 @@ map <leader>tr :NERDTreeRefreshRoot<cr>
88132
nnoremap <leader>a :Ack!<Space>
89133
map <leader>l :CtrlPBuffer<cr>
90134
91-
" General leader map
135+
" others
92136
map <leader>= :ALEFix<cr>
93-
map <leader>r :!ruby %<cr>
94137
map <Leader> <Plug>(easymotion-prefix)
95-
96-
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
97-
" Plugin "
98-
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
99-
call plug#begin('~/.vim/plugged')
100-
" Main plugin
101-
Plug 'scrooloose/nerdtree'
102-
Plug 'ctrlpvim/ctrlp.vim'
103-
Plug 'mileszs/ack.vim'
104-
Plug 'christoomey/vim-tmux-navigator'
105-
Plug 'tpope/vim-fugitive'
106-
Plug 'junegunn/gv.vim'
107-
Plug 'tpope/vim-commentary'
108-
Plug 'tpope/vim-surround'
109-
Plug 'tpope/vim-repeat'
110-
Plug 'neoclide/coc.nvim', {'branch': 'release'}
111-
Plug 'dense-analysis/ale'
112-
Plug 'easymotion/vim-easymotion'
113-
Plug 'kana/vim-textobj-user'
114-
" For Rails
115-
Plug 'vim-ruby/vim-ruby'
116-
Plug 'tpope/vim-rails'
117-
Plug 'neoclide/coc-solargraph', {'do': 'yarn install --frozen-lockfile'}
118-
Plug 'nelstrom/vim-textobj-rubyblock'
119-
Plug 'tpope/vim-endwise'
120-
" For Python
121-
Plug 'neoclide/coc-python', {'do': 'yarn install --frozen-lockfile'}
122-
" Frontend
123-
Plug 'pangloss/vim-javascript'
124-
Plug 'ap/vim-css-color'
125-
" UI
126-
Plug 'vim-airline/vim-airline'
127-
Plug 'morhetz/gruvbox'
128-
" other
129-
Plug 'suan/vim-instant-markdown', {'for': 'markdown'}
130-
" Plug 'neoclide/coc-prettier', {'do': 'yarn install --frozen-lockfile'}
131-
" Plug 'neoclide/coc-eslint', {'do': 'yarn install --frozen-lockfile'}
132-
call plug#end()
138+
autocmd Filetype ruby map <leader>r :!ruby %<cr>
139+
autocmd Filetype python map <leader>r :!python3 %<cr>
133140
134141
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
135142
" Plugin config "
136143
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
137144
" Ack
138-
" let g:ack_qhandler = "copen"
139145
if executable('ag')
140146
let g:ackprg = 'ag --vimgrep'
141147
endif
@@ -145,20 +151,15 @@ let g:ack_mappings = {
145151
\ 'gv': '<C-W><CR><C-W>L<C-W>p<C-W>J',
146152
\ 'q': '<C-W>p' }
147153

148-
" Scheme
149-
colorscheme gruvbox
150-
let g:gruvbox_contrast_dark='hard'
151-
set background=dark
152-
153154
" Airline config
155+
let g:airline_theme='gruvbox'
156+
let g:airline_powerline_fonts = 1
154157
let g:airline#extensions#tabline#enabled = 1
155158
let g:airline#extensions#tabline#show_tabs = 0
156-
let g:airline#extensions#ale#enabled = 1
159+
let g:airline#extensions#tabline#buffer_idx_mode = 1
157160
let g:airline#extensions#tabline#left_sep = ' '
158161
let g:airline#extensions#tabline#left_alt_sep = '|'
159-
let g:airline_theme='gruvbox'
160-
let g:airline_powerline_fonts = 1
161-
let g:airline#extensions#tabline#buffer_idx_mode = 1
162+
let g:airline#extensions#ale#enabled = 1
162163
nmap <leader>1 <Plug>AirlineSelectTab1
163164
nmap <leader>2 <Plug>AirlineSelectTab2
164165
nmap <leader>3 <Plug>AirlineSelectTab3
@@ -171,17 +172,13 @@ nmap <leader>9 <Plug>AirlineSelectTab9
171172
172173
" NERDTree
173174
let g:NERDTreeMouseMode=3
174-
let NERDTreeShowHidden=1 " Show hidden file
175+
let NERDTreeShowHidden=1
175176
let NERDTreeIgnore=['.git']
176177
let g:NERDTreeMapJumpPrevSibling=""
177178
let g:NERDTreeMapJumpNextSibling=""
178179
let NERDTreeMapOpenSplit='s'
179180
let NERDTreeMapOpenVSplit='v'
180181

181-
" Open NERDTree when open directory
182-
autocmd StdinReadPre * let s:std_in=1
183-
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
184-
185182
" Coc.nvim setting
186183
function! s:check_back_space() abort
187184
let col = col('.') - 1
@@ -208,7 +205,6 @@ if executable('ag')
208205
endif
209206

210207
" Ale plugin
211-
" let g:ale_fix_on_save = 1
212208
let b:ale_linters = ['flake8', 'pylint']
213209
let g:ale_fixers = {
214210
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
@@ -221,7 +217,7 @@ let g:ale_fixers = {
221217
\}
222218

223219
" Function
224-
" Don't close window, when deleting a buffer
220+
" Don't close window when deleting a buffer
225221
command! Bclose call <SID>BufcloseCloseIt()
226222
function! <SID>BufcloseCloseIt()
227223
let l:currentBufNum = bufnr("%")

zshrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,10 @@ export PATH="$PATH:`yarn global bin`"
104104
alias yt='mpsyt'
105105
alias ms='ncmpcpp'
106106
alias gg='googler -n 7'
107+
108+
# export
109+
export TLDR_HEADER='magenta bold underline'
110+
export TLDR_QUOTE='italic'
111+
export TLDR_DESCRIPTION='green'
112+
export TLDR_CODE='red'
113+
export TLDR_PARAM='blue'

0 commit comments

Comments
 (0)