+ Separate vim config to 4 files (for compatiblity)

This commit is contained in:
ziro 2020-07-12 13:51:24 +07:00
parent 82736abb53
commit f3b6aafe61
10 changed files with 2791 additions and 125 deletions

View file

@ -76,5 +76,6 @@ bspc rule -a qTox:qtox desktop='^9'
bspc rule -a pr:pr desktop='^10'
bspc rule -a firefox:Toolkit desktop='^3' state=floating
bspc rule -a org-fenix-llanfair-Llanfair:org-fenix-llanfair-Llanfair state=floating
bspc rule -a livesplit-one state=floating
bspc rule -a mpv:gl state=floating
bspc rule -a mpv state=floating

View file

@ -127,7 +127,7 @@ scroll-down = bspwm-deskprev
[bar/dwm]
;monitor = ${env:MONITOR}
;monitor-fallback = HDMI1
width = 100%
width = 40%
height = 28
;offset-x = 1%
;offset-y = 1%
@ -174,8 +174,8 @@ font-6 = "Nimbus Sans:bold:size=16;2"
font-7 = "Iosevka Nerd Font:bold:style=solid:size=6;2"
font-8 = "Iosevka Nerd Font:bold:style=solid:size=8;2"
; ----------------------------------------------------------------------------------------
modules-left = ewmh dividerS wirednetwork checktor temp covPos covSem dividerS
modules-center = date
modules-left =
modules-center =
modules-right = dividerS disk playerctl-tail playerctl mpd volume battery dividerS prompt
; ----------------------------------------------------------------------------------------

View file

@ -1 +1 @@
/home/ziro/.config/tdm/sessions/dwm
/home/ziro/.config/tdm/sessions/bspwm

File diff suppressed because it is too large Load diff

46
.config/vim/nix Normal file
View file

@ -0,0 +1,46 @@
" vim: filetype=vim
" =================
" Linux Specific Configuration
" =================
" ----- Cleaning up
set undodir=$XDG_DATA_HOME/vim/undo
set directory=$XDG_DATA_HOME/vim/swap
set backupdir=$XDG_DATA_HOME/vim/backup
set viewdir=$XDG_DATA_HOME/vim/view
if !has('nvim')
set viminfo+='1000,n$XDG_DATA_HOME/vim/viminfo
else
set viminfo+='1000,n$XDG_DATA_HOME/nvim/nviminfo
endif
set runtimepath=$XDG_CONFIG_HOME/vim,$VIMRUNTIME,$XDG_CONFIG_HOME/vim/after
let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc"
" ----- Mutt
au BufRead /tmp/mutt-* set tw=72
" ----- Execute Python
if !has("nvim")
autocmd FileType python map <buffer> <F9> :w<CR>:!clear; python3 "%"<CR>
autocmd FileType python imap <buffer> <F9> <esc>:w<CR>:!clear; python3 "%"<CR>
else
autocmd FileType python map <buffer> <F9> :w<CR>:vs<CR>:ter python3 "%"<CR>
autocmd FileType python imap <buffer> <F9> <esc> :w<CR>:vs<CR>:ter python3 "%"<CR>
endif
" ----- Automatically Render PDF
autocmd FileType plaintex command! -nargs=0 Lw w !pdflatex % > /dev/null
autocmd FileType tex command! -nargs=0 Lw w !pdflatex % > /dev/null
" ----- Auto refresh vimrc
augroup myvimrc
au!
au BufWritePost vimrc so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
augroup END
" ----- Install plug (Plugin Manager)
if empty(glob('~/.config/vim/autoload/plug.vim'))
silent !curl -fLo ~/.config/vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

65
.config/vim/plugins Normal file
View file

@ -0,0 +1,65 @@
" vim: filetype=vim
" =================
" PlugIns
" =================
" ----- List of used plugins
call plug#begin('~/.local/share/vim/bundle')
Plug 'deoplete-plugins/deoplete-jedi'
Plug 'kovetskiy/sxhkd-vim'
Plug 'lervag/vimtex'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
Plug 'preservim/nerdcommenter'
" Plug 'ycm-core/YouCompleteMe'
Plug 'preservim/nerdtree'
Plug 'ryanoasis/vim-devicons'
if !has('nvim')
Plug 'ptzz/lf.vim'
else
Plug 'ptzz/lf.vim'
Plug 'rbgrouleff/bclose.vim'
endif
Plug 'tpope/vim-commentary'
call plug#end()
" ----- PlugIns Configuration
" - deoplete
let g:deoplete#enable_at_startup = 1
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
" - Lf
let g:lf_map_keys = 0
map <C-n> :Lf<CR>
" - YouCompleteMe
" let g:ycm_autoclose_preview_window_after_completion = 1
" - Powerline Integraton
let g:airline_powerline_fonts = 1
let g:airline_left_sep=' '
let g:airline_right_sep=' '
let g:airline_theme='onedark'
" - Snippet
let g:UltiSnipsExpandTrigger="<C-Tab>"
let g:UltiSnipsJumpForwardTrigger="<C-Tab>"
let g:UltiSnipsJumpBackwardTrigger="<S-Tab>"
let g:UltiSnipsEditSplit="vertical"

48
.config/vim/universal Normal file
View file

@ -0,0 +1,48 @@
" vim: filetype=vim
" =================
" Universal (Works on any OS... probably) Configuration
" =================
" ----- Vim Initial Config
set encoding=UTF-8
set hls
set number
set ignorecase
set smartcase
set mouse=a
syntax on
filetype indent plugin on
" map <C-n> :NERDTreeToggle<CR>
" ----- Mapping
" Norm but in shortcut
vnoremap . :normal .<CR>
" Map ctrl + u as U
noremap <C-u> U
" Map U as redo (ctrl + r)
noremap U <C-r>
" Yank and Put to/from clipboard/primary
noremap <C-y> "+y
noremap <C-p> "+p
noremap <C-Y> "+y
noremap <C-P> "+P
" NERDComment thing
map <C-l> gcc
vmap <C-l> gc
imap <C-l> <esc>gc
" ----- 'vim -b' = edit binary using xxd-format!
augroup Binary
au!
au BufReadPre *.bin let &bin=1
au BufReadPost *.bin if &bin | %!xxd
au BufReadPost *.bin set ft=xxd | endif
au BufWritePre *.bin if &bin | %!xxd -r
au BufWritePre *.bin endif
au BufWritePost *.bin if &bin | %!xxd
au BufWritePost *.bin set nomod | endif
augroup END

View file

@ -1,127 +1,19 @@
" - Cleaning Up
set undodir=$XDG_DATA_HOME/vim/undo
set directory=$XDG_DATA_HOME/vim/swap
set backupdir=$XDG_DATA_HOME/vim/backup
set viewdir=$XDG_DATA_HOME/vim/view
if !has('nvim')
set viminfo+='1000,n$XDG_DATA_HOME/vim/viminfo
else
set viminfo+='1000,n$XDG_DATA_HOME/nvim/nviminfo
endif
set runtimepath=$XDG_CONFIG_HOME/vim,$VIMRUNTIME,$XDG_CONFIG_HOME/vim/after
let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc"
" vim: filetype=vim
" =================
" VIM MAIN CONFIG
" =================
" - Mutt
au BufRead /tmp/mutt-* set tw=72
" ----- Mapping/Config
" Universal
so ~/.config/vim/universal
" so C:\_config\vim\universal
"
set encoding=UTF-8
set hls
set number
set ignorecase
set smartcase
set mouse=a
" map <C-n> :NERDTreeToggle<CR>
"
" *nix (Linux/Mac)
so ~/.config/vim/nix
" - Mapping + Settings
" Norm but in shortcut
vnoremap . :normal .<CR>
" Map ctrl + u as U
noremap <C-u> U
" Map U as redo (ctrl + r)
noremap U <C-r>
" Yank and Put to/from clipboard/primary
noremap <C-y> "+y
noremap <C-p> "+p
noremap <C-Y> "+y
noremap <C-P> "+P
" NERDComment thing
map <C-l> gcc
imap <C-l> <esc>gc i
" ----
" specific type maps --
if !has("nvim")
autocmd FileType python map <buffer> <F9> :w<CR>:!clear; python3 "%"<CR>
autocmd FileType python imap <buffer> <F9> <esc>:w<CR>:!clear; python3 "%"<CR>
else
autocmd FileType python map <buffer> <F9> :w<CR>:!echo -e "executing '%'...\n";python3 "%"<CR>
autocmd FileType python imap <buffer> <F9> <esc>:w<CR>:!echo -e "executing '%'...\n";python3 "%"<CR>
endif
" autocmd FileType python imap <buffer> <F9> <esc>:w<CR>:exec '!clear; python "%"'<CR>
autocmd FileType plaintex command! -nargs=0 Lw w !pdflatex % > /dev/null
autocmd FileType tex command! -nargs=0 Lw w !pdflatex % > /dev/null
" Windows
" so C:\_config\vim\windows
" -------------
" Sw (sudo w) to save as root
command! -nargs=0 W w !sudo tee % > /dev/null
cmap w!! w !sudo tee > /dev/null %
" - Auto refresh vimrc
augroup myvimrc
au!
au BufWritePost vimrc so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
augroup END
syntax on
filetype indent plugin on
" - PlugIns
if empty(glob('~/.config/vim/autoload/plug.vim'))
silent !curl -fLo ~/.config/vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.local/share/vim/bundle')
Plug 'kovetskiy/sxhkd-vim'
Plug 'lervag/vimtex'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
" if has('nvim')
" Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" else
" Plug 'Shougo/deoplete.nvim'
" Plug 'roxma/nvim-yarp'
" Plug 'roxma/vim-hug-neovim-rpc'
" endif
Plug 'preservim/nerdcommenter'
" Plug 'ycm-core/YouCompleteMe'
Plug 'preservim/nerdtree'
Plug 'ryanoasis/vim-devicons'
if !has('nvim')
Plug 'ptzz/lf.vim'
else
Plug 'ptzz/lf.vim'
Plug 'rbgrouleff/bclose.vim'
endif
Plug 'tpope/vim-commentary'
call plug#end()
" - Lf
let g:lf_map_keys = 0
map <C-n> :Lf<CR>
" - YouCompleteMe
let g:ycm_autoclose_preview_window_after_completion = 1
" - Powerline Integraton
let g:airline_powerline_fonts = 1
let g:airline_left_sep=' '
let g:airline_right_sep=' '
let g:airline_theme='onedark'
" - Snippet
let g:UltiSnipsExpandTrigger="<C-Tab>"
let g:UltiSnipsJumpForwardTrigger="<C-Tab>"
let g:UltiSnipsJumpBackwardTrigger="<S-Tab>"
let g:UltiSnipsEditSplit="vertical"
source ~/.config/vim/plugins

14
.config/vim/windows Normal file
View file

@ -0,0 +1,14 @@
" vim: filetype=vim
" =================
" Windows Specific Configuration
" =================
" ----- Install plug (Plugin Manager)
md ~\AppData\Local\nvim-data\site\autoload
$uri = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
(New-Object Net.WebClient).DownloadFile(
$uri,
$ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath(
"~\AppData\Local\nvim-data\site\autoload\plug.vim"
)
)

View file

@ -25,6 +25,9 @@ setopt auto_cd # auto cd if directory
# Theme
[ -f ~/.config/zsh/theme ] && source ~/.config/zsh/theme
# opam
test -r /home/ziro/.opam/opam-init/init.zsh && . /home/ziro/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true
# History in cache directory
HISTFILE=~/.cache/zsh/zsh_history
HISTSIZE=1000