Skip to content

Instantly share code, notes, and snippets.

@dpo
Created September 24, 2019 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpo/9065b437ca74c252797a51eb0ae36482 to your computer and use it in GitHub Desktop.
Save dpo/9065b437ca74c252797a51eb0ae36482 to your computer and use it in GitHub Desktop.
set -g prefix Home
unbind C-b
bind-key Home send-prefix
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# tmux-resurrect and tmux-continuum to save the state across system restarts
# prefix-Ctrl-s to save the state
# prefix-Ctrl-r to restore the state
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# tmux-yank: Copy to the system clipboard in tmux
set -g @plugin 'tmux-plugins/tmux-yank'
# tmux-cpu: Enables displaying CPU and GPU information in Tmux status-right and status-left
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g status-right '#{cpu_bg_color} CPU: #{cpu_icon} #{cpu_percentage} | %a %h-%d %H:%M '
# local customizations
set -g mouse off
set -g base-index 1 # number windows starting from 1 instead of 0
setw -g pane-base-index 1 # number panes starting from 1 instead of 0
bind r source-file ~/.tmux.conf \; display "Reloaded!" # reload this config file with prefix-r
bind | split-window -h # more intuitive characters to split a window into panes
bind - split-window -v
setw -g mode-keys vi
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
unbind n
bind < previous-window # use prefix-< and prefix-> to cycle through windows
bind > next-window
# enable true colors so tmux and terminal colors match
# https://github.com/tmux/tmux/issues/1246#issuecomment-493454336
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",*256col*:Tc"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run -b '~/.tmux/plugins/tpm/tpm'
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-tbone'
Plug 'airblade/vim-gitgutter'
Plug 'junegunn/fzf', { 'do': 'yes \| ./install' } " fzf is a fuzzy file search
Plug 'junegunn/fzf.vim'
Plug 'tmux-plugins/vim-tmux'
Plug 'JuliaEditorSupport/julia-vim'
" Plug 'autozimu/LanguageClient-neovim', {'branch': 'next', 'do': 'bash install.sh'}
" Plug 'roxma/nvim-completion-manager' " optional
Plug 'vim-pandoc/vim-pandoc'
Plug 'vim-pandoc/vim-pandoc-syntax'
Plug 'lervag/vimtex'
" Autocompletion with Deoplete
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
Plug 'SirVer/ultisnips' " snippets engine
Plug 'honza/vim-snippets' " actual snippets
Plug 'dense-analysis/ale' " syntax checking / linting
Plug 'sonph/onehalf', {'rtp': 'vim/'}
" Initialize plugin system
call plug#end()
" local customization
set expandtab " Replace all tabs by spaces.
set textwidth=0 " Do not limit the number of columns in general.
set shiftwidth=2 " Number of spaces to auto indent.
set tabstop=2 " Default width of a tab.
set shiftround " Use multiple of shiftwidth when indenting with '<' and '>'.
set scrolloff=3 " Keep 3 context lines above and below the cursor.
set linebreak " Don't wrap text in the middle of a word.
set number " Show line numbers.
autocmd BufEnter * silent! lcd %:p:h " automatically change to current file's dir
" highlight the current line
" :hi CursorLine cterm=bold
:set cursorline
" Deoplete configuration
let g:deoplete#enable_at_startup = 1
source ~/dotfiles/vimrc/fzf.vim
" source ~/dotfiles/vimrc/julia.vim
source ~/dotfiles/vimrc/vimtex.vim
source ~/dotfiles/vimrc/colorscheme.vim
set t_ZH=
set t_ZR=
" ALE configuration
let g:ale_linters = {
\ 'latex': ['chktex'],
\}
let g:ale_sign_warning = '!'
let g:ale_sign_error = '!!'
" only run linters on save
let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_insert_leave = 0
" UltiSnips configuration
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsSnippetDirectories=["UltiSnips", "my-ultisnips"]
" inspired by
" https://stefan.sofa-rockers.org/2018/10/23/macos-dark-mode-terminal-vim
function! SetBackgroundMode(...)
let s:isdarkmode = trim(system("isdarkmode2"))
if s:isdarkmode ==? "true"
colorscheme onehalfdark
let &background = "dark"
else
colorscheme onehalflight
let &background = "light"
endif
endfunction
" check every half hour
call SetBackgroundMode()
call timer_start(1800000, "SetBackgroundMode", {"repeat": -1})
set t_Co=256
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
" colorscheme onehalflight
nnoremap <silent> <leader>f :Files<CR>
nnoremap <silent> <leader>b :Buffers<CR>
nnoremap <silent> <leader>h :History<CR>
let g:default_julia_version = '1.2'
" language server
let g:LanguageClient_autoStart = 1
let g:LanguageClient_serverCommands = {
\ 'julia': ['julia', '--startup-file=no', '--history-file=no', '-e', '
\ using LanguageServer;
\ using Pkg;
\ import StaticLint;
\ import SymbolServer;
\ env_path = dirname(Pkg.Types.Context().env.project_file);
\ debug = false;
\
\ server = LanguageServer.LanguageServerInstance(stdin, stdout, debug, env_path, "", Dict());
\ server.runlinter = true;
\ run(server);
\ ']
\ }
nnoremap <silent> K :call LanguageClient_textDocument_hover()<CR>
nnoremap <silent> gd :call LanguageClient_textDocument_definition()<CR>
" nnoremap <silent> <F2> :call LanguageClient_textDocument_rename()<CR>
let g:vimtex_view_general_viewer = '/Applications/Skim.app/Contents/SharedSupport/displayline'
let g:vimtex_view_general_options = '-r @line @pdf @tex'
let g:vimtex_latexmk_continuous = 0
let g:vimtex_compiler_latexmk = {
\ 'options' : [
\ '-pdf',
\ '-shell-escape',
\ '-verbose',
\ '-file-line-error',
\ '-synctex=1',
\ '-interaction=nonstopmode',
\ ],
\}
" Autocompletion with Deoplete
call deoplete#custom#var('omni', 'input_patterns', {
\ 'tex': g:vimtex#re#deoplete
\})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment