summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jet tsang zeon-git <zeon-git@jettsang.com> 2024-02-01 22:50:11 +0800
committerGravatar jet tsang zeon-git <zeon-git@jettsang.com> 2024-02-01 22:50:11 +0800
commit00664399ecc1315ca8e7f862d8b4d69e133ca88b (patch)
tree6558e5f011d4932d0d5ca37da0329f2c9081b086
downloadmyconf-00664399ecc1315ca8e7f862d8b4d69e133ca88b.tar.gz
myconf-00664399ecc1315ca8e7f862d8b4d69e133ca88b.tar.bz2
myconf-00664399ecc1315ca8e7f862d8b4d69e133ca88b.zip
init
-rw-r--r--tmux.conf72
-rw-r--r--vimrc205
2 files changed, 277 insertions, 0 deletions
diff --git a/tmux.conf b/tmux.conf
new file mode 100644
index 0000000..78fcae0
--- /dev/null
+++ b/tmux.conf
@@ -0,0 +1,72 @@
+set-option -g status-style bg=colour235 #base02
+set-option -g status-style fg=colour136 #yellow
+
+bind-key v split-window -h
+bind-key b split-window
+
+set-window-option -g window-status-style fg=colour244 #base0
+set-window-option -g window-status-style bg=default
+
+set-window-option -g window-status-current-style fg=colour166 #orange
+set-window-option -g window-status-current-style bg=default
+
+set-option -g pane-border-style fg=colour235 #base02
+set-option -g pane-active-border-style fg=colour240 #base01
+
+set-option -g message-style bg=colour235 #base02
+set-option -g message-style fg=colour166 #orange
+
+set-option -g display-panes-active-colour colour33 #blue
+set-option -g display-panes-colour colour166 #orange
+set-window-option -g clock-mode-colour green #green
+
+
+set -g status-interval 1
+set -g status-justify centre # center align window list
+set -g status-left-length 100
+set -g status-right-length 140
+set -g status-left "#[fg=colour14]#(whoami)@#h #[fg=colour11]#S#[default]"
+
+set -g status-right '#[fg=green,bg=default,bright]#(tmux-mem-cpu-load) #[fg=yellow,dim,bg=default]#(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") #[fg=white,bright]#(TZ=Asia/Hong_Kong date)'
+
+
+set -g base-index 1
+
+set -s escape-time 0
+
+setw -g aggressive-resize on
+
+set -g mouse on
+
+set -g prefix C-a
+unbind C-b
+bind C-a send-prefix
+
+setw -g monitor-activity on
+set -g visual-activity on
+
+set-window-option -g mode-keys vi
+bind-key -T copy-mode-vi v send-keys -X begin-selection
+bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
+
+bind h select-pane -L
+bind j select-pane -D
+bind k select-pane -U
+bind l select-pane -R
+
+bind H resize-pane -L
+bind J resize-pane -D
+bind K resize-pane -U
+bind L resize-pane -R
+
+bind m set-window-option main-pane-height 60\; select-layout main-horizontal
+
+bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
+
+bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
+
+set-window-option -g automatic-rename
+
+set -g default-terminal "screen-256color"
+set-option -g history-limit 13000
+
diff --git a/vimrc b/vimrc
new file mode 100644
index 0000000..fed86ba
--- /dev/null
+++ b/vimrc
@@ -0,0 +1,205 @@
+" Improved Vim settings
+set nocompatible
+set background=dark
+set nu
+set dir=$HOME/.vim_tmp/swap
+imap <C-c> <Esc>
+if !isdirectory(&dir) | call mkdir(&dir, 'p', 0700) | endif
+
+" Runtime path configuration
+set rtp+=~/.vim/bundle/Vundle.vim
+call vundle#begin()
+
+" Vundle plugin management
+Plugin 'VundleVim/Vundle.vim'
+Plugin 'tpope/vim-fugitive'
+Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
+Plugin 'fatih/vim-go'
+Plugin 'scrooloose/nerdtree'
+Plugin 'Xuyuanp/nerdtree-git-plugin'
+Plugin 'kien/ctrlp.vim'
+Plugin 'vim-airline/vim-airline'
+Plugin 'vim-airline/vim-airline-themes'
+Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
+Plugin 'posva/vim-vue'
+Plugin 'scrooloose/syntastic'
+Plugin 'Chiel92/vim-autoformat'
+Plugin 'eugen0329/vim-esearch'
+Plugin 'majutsushi/tagbar'
+Plugin 'dgryski/vim-godef'
+Plugin 'tpope/vim-surround'
+Bundle 'sudar/comments.vim'
+Plugin 'flazz/vim-colorschemes'
+Plugin 'nsf/gocode', {'rtp': 'vim/'}
+Plugin 'leafgarland/typescript-vim'
+Plugin 'peitalin/vim-jsx-typescript'
+Plugin 'rust-lang/rust.vim'
+Plugin 'madox2/vim-ai'
+Plugin 'neoclide/coc.nvim', {'branch': 'master', 'do': 'npm ci'}
+
+call vundle#end()
+filetype plugin indent on
+syntax enable
+let g:airline#extensions#tabline#enabled = 1
+
+" NERDTree settings
+map <C-n> :NERDTreeToggle<CR>
+autocmd StdinReadPre * let s:std_in=1
+autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
+autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
+let NERDTreeMinimalUI=1
+let NERDTreeShowHidden=1
+
+" CtrlP settings
+let g:ctrlp_working_path_mode = 'ra'
+set wildignore+=*/tmp/*,*/node_modules/*,*.so,*.swp,*.zip,*.gz,*.tar
+let g:ctrlp_custom_ignore = {'dir': '\v[\/]\.(git|hg|svn)$', 'file': '\v\.(exe|so|dll)$'}
+
+" General settings
+set encoding=utf-8
+set t_Co=256
+set term=xterm-256color
+set termencoding=utf-8
+
+" Syntastic settings
+let g:syntastic_javascript_checkers = ['eslint']
+let g:syntastic_always_populate_loc_list = 1
+let g:formatters_javascript = ['eslint']
+let g:formatters_vue = ['eslint']
+noremap <F3> :Autoformat<CR>
+
+" Go settings
+let g:go_fmt_command = "goimports"
+let g:tagbar_type_go = {
+ \ 'ctagstype' : 'go',
+ \ 'kinds' : [
+ \ 'p:package',
+ \ 'i:imports:1',
+ \ 'c:constants',
+ \ 'v:variables',
+ \ 't:types',
+ \ 'n:interfaces',
+ \ 'w:fields',
+ \ 'e:embedded',
+ \ 'm:methods',
+ \ 'r:constructor',
+ \ 'f:functions'
+ \ ],
+ \ 'sro' : '.',
+ \ 'kind2scope' : {
+ \ 't' : 'ctype',
+ \ 'n' : 'ntype'
+ \ },
+ \ 'scope2kind' : {
+ \ 'ctype' : 't',
+ \ 'ntype' : 'n'
+ \ },
+ \ 'ctagsbin' : 'gotags',
+ \ 'ctagsargs' : '-sort -silent'
+\ }
+let g:godef_split=2
+let g:syntastic_go_checkers = ['govet', 'errcheck', 'go']
+
+" Filetype settings
+autocmd BufNewFile,BufRead *.vue set ft=vue
+autocmd Filetype yaml setlocal tabstop=8
+autocmd Filetype go setlocal tabstop=8
+autocmd FileType vue :call ESlintVueFormatter()
+autocmd FileType javascript :call ESlintJSFormatter()
+autocmd FileType javascript nnoremap <buffer> <localleader>c I//<esc>
+autocmd FileType python nnoremap <buffer> <localleader>c I#<esc>
+
+" Indentation settings
+set ts=8
+set expandtab
+set autoindent
+set nowrap
+
+" Mouse and paste settings
+set mouse=a
+set pastetoggle=<F2>
+
+" Commenting settings
+let g:comments_map_keys = 0
+noremap <silent> <C-k> :call CommentLine()<CR>
+vnoremap <silent> <C-k> :call RangeCommentLine()<CR>
+noremap <silent> <C-l> :call UnCommentLine()<CR>
+vnoremap <silent> <C-l> :call RangeUnCommentLine()<CR>
+
+" Color scheme
+color blackboard
+
+" TypeScript settings
+let g:typescript_compiler_binary = 'tsc'
+let g:typescript_compiler_options = ''
+let g:go_gopls_enabled = 0
+autocmd BufNewFile,BufRead *.ts set filetype=typescript
+autocmd FileType typescript :set makeprg=tsc
+autocmd BufNewFile,BufRead *.tsx,*.jsx set filetype=typescript.tsx
+
+" Rust settings
+let g:rustfmt_autosave = 1
+
+" AI integration
+let g:vim_ai_complete = {
+\ "options": {
+\ "model": "gpt-4-turbo-preview",
+\ "endpoint_url": "https://api.openai.com/v1/chat/completions",
+\ "temperature": 0.1,
+\ "request_timeout": 20,
+\ },
+\}
+
+let g:vim_ai_edit = {
+\ "options": {
+\ "model": "gpt-4-turbo-preview",
+\ "endpoint_url": "https://api.openai.com/v1/chat/completions",
+\ "temperature": 0.1,
+\ "request_timeout": 20,
+\ },
+\}
+
+let initial_prompt =<< trim END
+You are going to play a role of a completion engine with following parameters:
+Task: Provide compact code/text completion, generation, transformation or explanation
+Topic: general programming and text editing
+Style: Plain result without any commentary, unless commentary is necessary
+Audience: Users of text editor and programmers that need to transform/generate text
+END
+
+let chat_engine_config = {
+\ "engine": "chat",
+\ "options": {
+\ "endpoint_url": "https://api.openai.com/v1/chat/completions",
+\ "model": "gpt-4-turbo-preview",
+\ "max_tokens": 128000,
+\ "temperature": 0.1,
+\ "request_timeout": 30,
+\ "selection_boundary": "",
+\ "initial_prompt": initial_prompt,
+\ },
+\}
+
+let g:vim_ai_complete = chat_engine_config
+let g:vim_ai_edit = chat_engine_config
+let g:vim_ai_debug = 1
+
+" Custom commands
+command! GitCommitMessage call GitCommitMessageFn()
+command! -range CodeReview <line1>,<line2>call CodeReviewFn(<range>)
+
+" Key mappings
+nnoremap <leader>a :AI<CR>
+xnoremap <leader>a :AI<CR>
+xnoremap <leader>s :AIEdit fix grammar and spelling<CR>
+nnoremap <leader>s :AIEdit fix grammar and spelling<CR>
+xnoremap <leader>c :AIChat<CR>
+nnoremap <leader>c :AIChat<CR>
+nnoremap <leader>r :AIRedo<CR>
+
+" Rust key mappings
+nmap <silent> gd <Plug>(coc-definition)
+nmap <silent> gy <Plug>(coc-type-definition)
+nmap <silent> gi <Plug>(coc-implementation)
+nmap <silent> gr <Plug>(coc-references)
+nnoremap <silent> K :call <SID>show_documentation()<CR>