diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 3b832f9..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.localcommands -.vim/bundle/* diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..1af14d0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "dotbot"] + path = dotbot + url = https://github.com/anishathalye/dotbot + ignore = dirty diff --git a/README.md b/README.md index 5128bc1..111941d 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,15 @@ -# My Dotfiles with an installer +# My Dotfiles +The collection of my precious dotfiles. -These are just my own config files for various applications like atom, vim and zsh... -It also contains an installation script "setup.sh" to easily apply all of the settings and install some needed tools like -Vundle. - -## Usage -Make sure you have these packages installed: -- atom -- vim -- zsh -- oh-my-zsh -- tmux -- tmuxinator -- the_silver_surfer -- powerline-fonts -- fzf - -If you want to install and apply all of the settings you just need to run: +## Installation +To install run this command: ``` -cd ~ -git clone https://github.com/saibotk/.dotfiles -.dotfiles/setup.sh +git clone https://github.com/saibotk/.dotfiles ~/; cd ~/.dotfiles; ./install ``` +This should install all dependecies and create symlinks to all needed files. The only thing that you have to setup on your own is `nvim`. + +## Customization +It is possible to load your own zsh-plugins and other commands you want to execute in the `.zshrc`. To add zsh-plugins add a `plugins` file to `~/.dotfiles/shell/`. An example is provided in `~/.dotfiles/shell/plugins.example`. The same thing applies to commands you want to execute in on shell startup, just add a `localcommands` file with your commands in `~/.dotfiles/shell/`. ## Atom packages If you plan on using you own atom package list, you can modify the "atom/packages.list". diff --git a/dotbot b/dotbot new file mode 160000 index 0000000..2c8a043 --- /dev/null +++ b/dotbot @@ -0,0 +1 @@ +Subproject commit 2c8a0431edfd826c8caa4afbfa22ca408e745db6 diff --git a/install b/install new file mode 100755 index 0000000..5a7e72c --- /dev/null +++ b/install @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -e + +CONFIG="install.conf.yaml" +DOTBOT_DIR="dotbot" + +DOTBOT_BIN="bin/dotbot" +BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +cd "${BASEDIR}" +git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive +git submodule update --init --recursive "${DOTBOT_DIR}" + +"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}" diff --git a/install.conf.yaml b/install.conf.yaml new file mode 100644 index 0000000..85f09fb --- /dev/null +++ b/install.conf.yaml @@ -0,0 +1,43 @@ +- defaults: + link: + relink: true + create: true + +# clean config and home directory from bad symbolic links +- clean: ['~', '.config/'] + +- link: + ~/.tmux.conf: + path: shell/tmux.conf + ~/.vimrc: + path: vim/vimrc + ~/.vim: + path: vim/vim + ~/.config/nvim: + path: nvim + +- shell: + # install ohmyzsh + - + command: 'if [ ! -d ~/.oh-my-zsh ]; then sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; fi' + stdin: false + stdout: true + description: "Install ohmyzsh:" + quiet: false + # install vim plug for vim + - [curl -fLo vim/vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim, "Install vim-plug for vim:"] + # install vim plug for nvim + - [curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim, "Install vim-plug for nvim:"] + # install vim plugins + - + command: vim +PlugInstall +qall + stdin: true + stdout: true + description: "Install vim plugins! Hit enter once if stuck:" + quiet: false + +# do this last to override generated .zshrc +- link: + ~/.zshrc: + force: true + path: shell/zshrc diff --git a/nvim/.gitignore b/nvim/.gitignore new file mode 100644 index 0000000..ddf2379 --- /dev/null +++ b/nvim/.gitignore @@ -0,0 +1 @@ +bundle/ diff --git a/nvim/functions.vim b/nvim/functions.vim new file mode 100644 index 0000000..376f962 --- /dev/null +++ b/nvim/functions.vim @@ -0,0 +1,84 @@ +" FUNCTIONS + +" auto reload .vimrc on write +autocmd BufWritePost init.vim source % + +" toggle hybrid number mode +:augroup numbertoggle +: autocmd! +: autocmd BufEnter,FocusGained,InsertLeave * set relativenumber +: autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber +:augroup END + +" Delete buffer while keeping window layout (don't close buffer's windows). +" Version 2008-11-18 from http://vim.wikia.com/wiki/VimTip165 +if v:version < 700 || exists('loaded_bclose') || &cp + finish +endif +let loaded_bclose = 1 +if !exists('bclose_multiple') + let bclose_multiple = 1 +endif + +" Display an error message. +function! s:Warn(msg) + echohl ErrorMsg + echomsg a:msg + echohl NONE +endfunction + +" Command ':Bclose' executes ':bd' to delete buffer in current window. +" The window will show the alternate buffer (Ctrl-^) if it exists, +" or the previous buffer (:bp), or a blank buffer if no previous. +" Command ':Bclose!' is the same, but executes ':bd!' (discard changes). +" An optional argument can specify which buffer to close (name or number). +function! s:Bclose(bang, buffer) + if empty(a:buffer) + let btarget = bufnr('%') + elseif a:buffer =~ '^\d\+$' + let btarget = bufnr(str2nr(a:buffer)) + else + let btarget = bufnr(a:buffer) + endif + if btarget < 0 + call s:Warn('No matching buffer for '.a:buffer) + return + endif + if empty(a:bang) && getbufvar(btarget, '&modified') + call s:Warn('No write since last change for buffer '.btarget.' (use :Bclose!)') + return + endif + " Numbers of windows that view target buffer which we will delete. + let wnums = filter(range(1, winnr('$')), 'winbufnr(v:val) == btarget') + if !g:bclose_multiple && len(wnums) > 1 + call s:Warn('Buffer is in multiple windows (use ":let bclose_multiple=1")') + return + endif + let wcurrent = winnr() + for w in wnums + execute w.'wincmd w' + let prevbuf = bufnr('#') + if prevbuf > 0 && buflisted(prevbuf) && prevbuf != btarget + buffer # + else + bprevious + endif + if btarget == bufnr('%') + " Numbers of listed buffers which are not the target to be deleted. + let blisted = filter(range(1, bufnr('$')), 'buflisted(v:val) && v:val != btarget') + " Listed, not target, and not displayed. + let bhidden = filter(copy(blisted), 'bufwinnr(v:val) < 0') + " Take the first buffer, if any (could be more intelligent). + let bjump = (bhidden + blisted + [-1])[0] + if bjump > 0 + execute 'buffer '.bjump + else + execute 'enew'.a:bang + endif + endif + endfor + execute 'bdelete'.a:bang.' '.btarget + execute wcurrent.'wincmd w' +endfunction +command! -bang -complete=buffer -nargs=? Bclose call Bclose(, ) +nnoremap bd :Bclose diff --git a/nvim/init.vim b/nvim/init.vim new file mode 100644 index 0000000..ca0db41 --- /dev/null +++ b/nvim/init.vim @@ -0,0 +1,12 @@ +let g:nvim_config_root = stdpath('config') +let g:config_file_list = [ +\ 'plugins.vim', +\ 'options.vim', +\ 'mappings.vim', +\ 'functions.vim', +\ 'pluginoptions.vim', +\ ] + +for f in g:config_file_list + execute 'source ' . g:nvim_config_root . '/' . f +endfor diff --git a/nvim/luna.vim b/nvim/luna.vim new file mode 100644 index 0000000..1c363d3 --- /dev/null +++ b/nvim/luna.vim @@ -0,0 +1,73 @@ + +let g:airline#themes#luna#palette = {} + +let g:airline#themes#luna#palette.accents = {'red': [ '#ffffff' , '' , 231 , '' , '' ], } + +let s:N1 = [ '#ffffff' , '#005252' , 231 , 36 ] +let s:N2 = [ '#ffffff' , '#3399aa' , 231 , 29 ] +let s:N3 = [ '#ffffff' , '#003636' , 231 , 23 ] +let g:airline#themes#luna#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) +let g:airline#themes#luna#palette.normal_modified = { + \ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] , + \ } + +let s:I1 = [ '#ffffff' , '#789f00' , 231 , 106 ] +let s:I2 = [ '#ffffff' , '#3399aa' , 231 , 29 ] +let s:I3 = [ '#ffffff' , '#003636' , 231 , 23 ] +let g:airline#themes#luna#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) +let g:airline#themes#luna#palette.insert_modified = {'airline_c': ['#ffffff' ,'#005e5e' ,255, 52, '']} +let g:airline#themes#luna#palette.insert_paste = { + \ 'airline_a': [ s:I1[0] , '#789f00' , s:I1[2] , 106 , '' ] , + \ } + +let g:airline#themes#luna#palette.replace = copy(g:airline#themes#luna#palette.insert) +let g:airline#themes#luna#palette.replace.airline_a = [ s:I2[0] , '#920000' , s:I2[2] , 88 , '' ] +let g:airline#themes#luna#palette.replace_modified = g:airline#themes#luna#palette.insert_modified + +let s:V1 = [ '#ffff9a' , '#ff8036' , 222 , 208 ] +let s:V2 = [ '#ffffff' , '#3399aa' , 231 , 29 ] +let s:V3 = [ '#ffffff' , '#003636' , 231 , 23 ] +let g:airline#themes#luna#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) +let g:airline#themes#luna#palette.visual_modified = { + \ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] , + \ } + +let s:IA = [ '#4e4e4e' , '#002b2b' , 59 , 23 , '' ] +let g:airline#themes#luna#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) +let g:airline#themes#luna#palette.inactive_modified = { + \ 'airline_c': [ '#e20000' , '' , 166 , '' , '' ] , + \ } + +let g:airline#themes#luna#palette.tabline = { + \ 'airline_tab': ['#2aa198', '#3399aa', 231, 29, ''], + \ 'airline_tabsel': ['#ffffff', '#2e8b57', 231, 36, ''], + \ 'airline_tabtype': ['#ffffff', '#005252', 231, 36, ''], + \ 'airline_tabfill': ['#ffffff', '#003636', 231, 23, ''], + \ 'airline_tabmod': ['#ffffff', '#780000', 231, 88, ''], + \ } + +let s:WI = [ '#ffffff', '#5f0000', 231, 88 ] +let g:airline#themes#luna#palette.normal.airline_warning = [ + \ s:WI[0], s:WI[1], s:WI[2], s:WI[3] + \ ] + +let g:airline#themes#luna#palette.normal_modified.airline_warning = + \ g:airline#themes#luna#palette.normal.airline_warning + +let g:airline#themes#luna#palette.insert.airline_warning = + \ g:airline#themes#luna#palette.normal.airline_warning + +let g:airline#themes#luna#palette.insert_modified.airline_warning = + \ g:airline#themes#luna#palette.normal.airline_warning + +let g:airline#themes#luna#palette.visual.airline_warning = + \ g:airline#themes#luna#palette.normal.airline_warning + +let g:airline#themes#luna#palette.visual_modified.airline_warning = + \ g:airline#themes#luna#palette.normal.airline_warning + +let g:airline#themes#luna#palette.replace.airline_warning = + \ g:airline#themes#luna#palette.normal.airline_warning + +let g:airline#themes#luna#palette.replace_modified.airline_warning = + \ g:airline#themes#luna#palette.normal.airline_warning diff --git a/nvim/mappings.vim b/nvim/mappings.vim new file mode 100644 index 0000000..7aa9cbe --- /dev/null +++ b/nvim/mappings.vim @@ -0,0 +1,19 @@ +" REMAPS +" search for visual selection +vnoremap // y/" +nnoremap H ^ + +" ex command +cnoremap +cnoremap + +" auto expand brackets +inoremap (; ()O +inoremap (, (),O +inoremap {; {}O +inoremap {, {},O +inoremap [; []O +inoremap [, [],O + +" toggle hybrid mode +nnoremap h :set rnu! diff --git a/nvim/options.vim b/nvim/options.vim new file mode 100644 index 0000000..6f6b16e --- /dev/null +++ b/nvim/options.vim @@ -0,0 +1,55 @@ +" OPTIONS + +" syntax +syntax on +let mapleader=" " + +" color settings +set termguicolors +colorscheme kuroi +set background=dark +hi MatchParen guibg=NONE guifg=red gui=bold + +" random settings +set number +set clipboard=unnamed +set mouse=nvi +" set smarttab +set expandtab +set tabstop=4 +set visualbell +set virtualedit=block +set scrolloff=1 +set wildmenu +set autoread +set lazyredraw +set history=250 +set noshowmode + +" tabs and line wrap +set tabstop=4 +set wrapmargin=8 +set softtabstop=0 noexpandtab +set shiftwidth=4 +set backspace=2 +set backspace=indent,eol,start +set encoding=utf-8 +set autoindent + +" search +set incsearch +set hlsearch +set smartcase + +" Disable Backup and Swap files +set noswapfile +set nobackup +set nowritebackup + +" setup split +set splitbelow +set splitright + +" Enable folding +set foldmethod=indent +set foldlevel=99 diff --git a/nvim/pluginoptions.vim b/nvim/pluginoptions.vim new file mode 100644 index 0000000..f14726f --- /dev/null +++ b/nvim/pluginoptions.vim @@ -0,0 +1,125 @@ +" PLUGIN OPTIONS + +" NERD TREE SETUP +" ========================= + +let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree + +map e :NERDTreeToggle + +" AIRLINE SETUP +" ========================= + +" sections +let g:airline_section_y = "" +let g:airline_section_z = "%l/%L:%c" +let g:airline_section_b = "%{airline#util#wrap(airline#extensions#branch#get_head(),0)}" +" other stuff +let g:airline_theme='luna' +let g:airline_powerline_fonts = 1 +let g:airline_inactive_collapse=1 +let g:airline_skip_empty_sections = 1 +let g:airline#extensions#whitespace#enabled = 0 +let g:airline#extensions#wordcount#enabled = 0 +let g:airline#extensions#keymap#enabled = 0 +set ttimeoutlen=50 + +" GITGUTTER SETUP +" ========================= + +let g:gitgutter_sign_added = '∙' +let g:gitgutter_sign_modified = '∙' +let g:gitgutter_sign_removed = '∙' +let g:gitgutter_sign_modified_removed = '∙' +augroup VimDiff + autocmd! + autocmd VimEnter,FilterWritePre * if &diff | GitGutterDisable | endif +augroup END + +" FZF SETUP +" ========================= + +nmap :Buffers +nmap f :GFiles +let g:fzf_buffers_jump = 1 + +" VIMWIKI SETUP +" ========================= + +let g:vimwiki_list = [{'path': '~/.wiki/'}] + +" VIMTEX SETUP +" ========================= + +let g:vimtex_compile_progname = 'nvr' +let g:tex_flavor = 'latex' + +" COLORS.LUA SETUP +" ========================= + +lua require'colorizer'.setup() + +" TMUX SETUP +" ========================= + +let g:tmuxcomplete#trigger = '' + +" GOYO +" ========================= + +function! s:goyo_enter() + set noshowcmd + set scrolloff=999 +endfunction + +function! s:goyo_leave() + set showcmd + set scrolloff=1 +endfunction + +autocmd! User GoyoEnter nested call goyo_enter() +autocmd! User GoyoLeave nested call goyo_leave() + +let g:goyo_linenr = 0 + +" AUTOCOMPLETION +" ========================= + +if executable('pyls') + au User lsp_setup call lsp#register_server({ + \ 'name': 'pyls', + \ 'cmd': {server_info->['pyls']}, + \ 'whitelist': ['python'], + \ }) +endif + +function! s:on_lsp_buffer_enabled() abort + setlocal omnifunc=lsp#complete + setlocal signcolumn=yes + nmap gd (lsp-definition) + nmap (lsp-rename) + " refer to doc to add more commands +endfunction + +augroup lsp_install + au! + " call s:on_lsp_buffer_enabled only for languages that has the server registered. + autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled() +augroup END + +" ULTISNIPS SETUP +" ========================= + +" Trigger configuration. Do not use if you use https://github.com/Valloric/YouCompleteMe. +let g:UltiSnipsExpandTrigger="" +let g:UltiSnipsJumpForwardTrigger="" +let g:UltiSnipsJumpBackwardTrigger="" +let g:UltiSnipsSnippetDirectories=[$HOME."/.vim/snipps"] + +" If you want :UltiSnipsEdit to split your window. +let g:UltiSnipsEditSplit="vertical" + +" EMMET SETUP +" ========================= + +let g:user_emmet_leader_key='' diff --git a/nvim/plugins.vim b/nvim/plugins.vim new file mode 100644 index 0000000..82f3ff6 --- /dev/null +++ b/nvim/plugins.vim @@ -0,0 +1,81 @@ +" PLUGINS +call plug#begin('~/.config/nvim/bundle') +" USEFUL +" =================== + +" Editor config +Plug 'editorconfig/editorconfig-vim' + +" comment plugin +Plug 'tpope/vim-commentary' + +" brackets management +Plug 'tpope/vim-surround' + +" Snippets +Plug 'SirVer/ultisnips' + +" WINDOW MANAGEMENT +" =================== + +" tmux navigator +Plug 'christoomey/vim-tmux-navigator' + +" winresizer +Plug 'simeji/winresizer' + +" goyo +Plug 'junegunn/goyo.vim' + +" FILE MANAGEMENT +" =================== + +" nerd-tree +Plug 'scrooloose/nerdtree' + +" fzf plugin +Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +Plug 'junegunn/fzf.vim' + +" vimwiki +Plug 'vimwiki/vimwiki' + +" GIT STUFF +" =================== + +" git +Plug 'tpope/vim-fugitive' + +" vim gitgutter +Plug 'airblade/vim-gitgutter' + +" COLORS +" =================== + +" Plastic colorscheme +Plug 'aonemd/kuroi.vim' + +" Color higlighting +Plug 'norcalli/nvim-colorizer.lua' + +" powerline +Plug 'vim-airline/vim-airline' + +" LANGUAGES +" =================== + +" Linting +Plug 'dense-analysis/ale' + +" disable latex before loading +let g:polyglot_disabled = ["latex"] +Plug 'sheerun/vim-polyglot' + +" latex +Plug 'lervag/vimtex' + +" Emmet +Plug 'mattn/emmet-vim' + +" All of your Plugins must be added before the following line +call plug#end() diff --git a/setup.sh b/setup.sh deleted file mode 100755 index 0b5438b..0000000 --- a/setup.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -commandExists() -{ - command -v "$1" >/dev/null 2>&1 -} - -backupFilesIfExists() -{ - if [ -f $1 ] || [ -h $1 ] || [ -d $1 ]; then - printf "Found $1. Backing up to $1.pre-dotfiles\n"; - mv $1 $1.pre-dotfiles; - fi -} - -# remove all current dotfiles -echo '[INFO] Removing current dotfiles...' -backupFilesIfExists ~/.zshrc -backupFilesIfExists ~/.vimrc -backupFilesIfExists ~/.vim -backupFilesIfExists ~/.inputrc -backupFilesIfExists ~/.tmux.conf -backupFilesIfExists ~/.atom - -# create symbolic links to dotfiles -echo '[INFO] Creating symlinks to new config files in .dotfiles...' -ln -s ~/.dotfiles/.vimrc ~/.vimrc -ln -s ~/.dotfiles/.zshrc ~/.zshrc -ln -s ~/.dotfiles/.vim ~/.vim -ln -s ~/.dotfiles/.inputrc ~/.inputrc -ln -s ~/.dotfiles/tmux.conf ~/.tmux.conf -ln -s ~/.dotfiles/.atom ~/.atom - -# install artisan plugin -if ! [ -d ~/.oh-my-zsh/custom/plugins/artisan ]; then - echo '[INFO] Installing artisan plugin...' - git clone https://github.com/jessarcher/zsh-artisan.git ~/.oh-my-zsh/custom/plugins/artisan -else - echo '[INFO] artisan plugin already installed.' -fi - -# install vundle -if ! [ -d ~/.vim/bundle/Vundle.vim ]; then - echo '[INFO] Installing Vundle...' - git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim -else - echo '[INFO] Vundle is already installed.' -fi - -if commandExists vim; then - echo '[INFO] Installing vim plugins via Vundle...' - vim +PluginInstall +qall -else - echo '[INFO] Vim is not installed, could not install the plugins.' -fi - -# if atom is installed install packages -if commandExists atom; then - if commandExists apm; then - if [ -f ~/.dotfiles/.atom/packages.list ]; then - read -p "Do you want to install your atom packages? (y/n) " answer - case ${answer:0:1} in - y|Y ) - echo '[INFO] Installing atom packages, this can take a while...' - apm install --packages-file ~/.dotfiles/.atom/packages.list - ;; - * ) - echo '[INFO] Skipping atom package installation' - ;; - esac - - else - echo '[INFO] Cannot find packages.list skipping atom package installation.' - fi - else - echo '[INFO] Atom is installed but the apm command is not available. Cannot import atom packages!' - fi -else - echo '[INFO] Skipping atom configuration because it seems like you did not install atom yet!' -fi - -echo 'Finished setup...' -echo 'You should restart your terminal to see the changes.' diff --git a/shell/.gitignore b/shell/.gitignore new file mode 100644 index 0000000..23b1fbf --- /dev/null +++ b/shell/.gitignore @@ -0,0 +1,2 @@ +localcommands +plugins diff --git a/shell/localcommands.example b/shell/localcommands.example new file mode 100644 index 0000000..dca1e02 --- /dev/null +++ b/shell/localcommands.example @@ -0,0 +1 @@ +alias vi="vim" diff --git a/shell/plugins.example b/shell/plugins.example new file mode 100644 index 0000000..bd169c1 --- /dev/null +++ b/shell/plugins.example @@ -0,0 +1,9 @@ +# plugins +plugins=( + git + pip + screen + artisan + fzf + z +) diff --git a/tmux.conf b/shell/tmux.conf similarity index 61% rename from tmux.conf rename to shell/tmux.conf index 1cab6ac..9bf71bc 100644 --- a/tmux.conf +++ b/shell/tmux.conf @@ -13,18 +13,19 @@ 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 -# default statusbar colors -set-option -g status-bg black - # reload tmux.conf with -r unbind r bind r \ source-file ~/.tmux.conf \;\ display 'Reloaded tmux config' -# pane number display -set-option -g display-panes-active-colour blue #blue -set-option -g display-panes-colour brightred #orange +bind -n M-h previous-window +bind -n M-l next-window +bind -n M-j switch-client -n +bind -n M-k switch-client -p +bind -n M-k switch-client -p + +bind-key -n M-s set-option status # start numbering at 1 set -g base-index 1 @@ -34,22 +35,26 @@ set -g pane-base-index 1 set -g status-interval 10 # clock -set-window-option -g clock-mode-colour green #green +set-window-option -g clock-mode-colour green # bell -set-window-option -g window-status-bell-style fg=black,bg=red #base02, red +set-window-option -g window-status-bell-style fg=black,bg=red + +# default statusbar colors +set-option -g status-bg black # term color set -g default-terminal "screen-256color" +set-option -ga terminal-overrides ",xterm-256color:Tc" # right status -set -g status-right '#[fg=colour3]#[fg=colour1]#[bg=colour1]#[fg=colour7] %H:%M %d-%b ' +set -g status-right '#[fg=#51000f]#[bg=#51000f]#[fg=#ffffff] %H:%M %d-%b ' # left status -set -g status-left '#[bg=colour1]#[fg=colour0]#{?client_prefix,#[bg=colour2],} ❐ #[bg=colour8]#[fg=colour1]#{?client_prefix,#[fg=colour2],}#{?window_zoomed_flag, 🔍 ,}#[fg=colour1] ' +set -g status-left '#[bg=#1A202C]#[fg=#ffffff]#{?client_prefix,#[bg=#51000f],} ❐ #[bg=colour8]#[fg=#1A202C]#{?client_prefix,#[fg=#51000f],}#{?window_zoomed_flag, #[fg=colour7]🔍 ,} ' # current window status -set -g window-status-current-format "#[fg=colour8]#[bg=colour1]#[fg=colour7]#[bg=colour1] #I #[fg=colour7] #W #[fg=colour1]#[bg=colour8]" +set -g window-status-current-format "#[fg=colour8]#[bg=#51000f]#[fg=colour7]#[bg=#51000f] #I #[fg=colour7] #W #[fg=#51000f]#[bg=colour8]" # normal window status set -g window-status-format "#[fg=colour244]#[bg=colour8]#I #[fg=colour240] #W" @@ -57,10 +62,4 @@ set -g window-status-format "#[fg=colour244]#[bg=colour8]#I #[fg=colour240] # # escape time set-option -sg escape-time 10 -# COLOURS -#colour0 (black) -#colour1 (red) -#colour2 (green) -#colour3 (yellow) -#colour4 (blue) -#colour7 (white) +set -g status-justify "left" diff --git a/.zshrc b/shell/zshrc similarity index 62% rename from .zshrc rename to shell/zshrc index 946407f..1efbe1f 100644 --- a/.zshrc +++ b/shell/zshrc @@ -4,21 +4,21 @@ export ZSH="$HOME/.oh-my-zsh" ZSH_THEME="robbyrussell" # plugins -plugins=( - git - pip - docker - command-not-found - screen - dirhistory - gradle - per-directory-history - fzf - artisan -) +if [ -f ~/.dotfiles/shell/plugins ] +then + source ~/.dotfiles/shell/plugins +else + plugins=( + git + pip + screen + z + ) +fi source $ZSH/oh-my-zsh.sh + # User configuration # Helper Functions @@ -32,12 +32,14 @@ export EDITOR='vim' # aliases alias ll='ls -l' -alias vi='vim' alias la='ls -la' alias :q='exit' +alias fresh="source ~/.zshrc" -if [ -f ~/.dotfiles/.localcommands ]; then - source ~/.dotfiles/.localcommands +# localcommands +if [ -f ~/.dotfiles/shell/localcommands ] +then + source ~/.dotfiles/shell/localcommands fi # Tmuxinator autocomplete @@ -52,4 +54,10 @@ fi export FZF_ALT_C_COMMAND='find . -type d' -export PATH="$PATH:$(ruby -e 'print Gem.user_dir')/bin" +if _has ruby; +then + export PATH="$PATH:$(ruby -e 'print Gem.user_dir')/bin" +fi + + +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh diff --git a/vim/.gitignore b/vim/.gitignore new file mode 100644 index 0000000..347b774 --- /dev/null +++ b/vim/.gitignore @@ -0,0 +1,2 @@ +vim/bundle/* +vim/autoload diff --git a/.vim/ftplugin/markdown.vim b/vim/vim/ftplugin/markdown.vim similarity index 100% rename from .vim/ftplugin/markdown.vim rename to vim/vim/ftplugin/markdown.vim diff --git a/.vim/ftplugin/python.vim b/vim/vim/ftplugin/python.vim similarity index 100% rename from .vim/ftplugin/python.vim rename to vim/vim/ftplugin/python.vim diff --git a/.vim/snipps/blade.snippets b/vim/vim/snipps/blade.snippets similarity index 100% rename from .vim/snipps/blade.snippets rename to vim/vim/snipps/blade.snippets diff --git a/.vim/snipps/css.snippets b/vim/vim/snipps/css.snippets similarity index 100% rename from .vim/snipps/css.snippets rename to vim/vim/snipps/css.snippets diff --git a/.vim/snipps/html.snippets b/vim/vim/snipps/html.snippets similarity index 80% rename from .vim/snipps/html.snippets rename to vim/vim/snipps/html.snippets index d45e01e..5106cf4 100644 --- a/.vim/snipps/html.snippets +++ b/vim/vim/snipps/html.snippets @@ -11,6 +11,10 @@ snippet tag "generic Element" endsnippet +snippet tags "generic Element self closing" +<${1:tag}${2: class="$3"} />$0 +endsnippet + snippet tagi "generic inline Element" <${1:tag}${2: class="$3"}>$4$0 endsnippet diff --git a/.vim/snipps/liquid.snippets b/vim/vim/snipps/liquid.snippets similarity index 100% rename from .vim/snipps/liquid.snippets rename to vim/vim/snipps/liquid.snippets diff --git a/.vim/snipps/markdown.snippets b/vim/vim/snipps/markdown.snippets similarity index 100% rename from .vim/snipps/markdown.snippets rename to vim/vim/snipps/markdown.snippets diff --git a/.vim/snipps/markwdown.snippets b/vim/vim/snipps/markwdown.snippets similarity index 100% rename from .vim/snipps/markwdown.snippets rename to vim/vim/snipps/markwdown.snippets diff --git a/.vim/snipps/php.snippets b/vim/vim/snipps/php.snippets similarity index 100% rename from .vim/snipps/php.snippets rename to vim/vim/snipps/php.snippets diff --git a/.vim/snipps/plaintex.snippets b/vim/vim/snipps/plaintex.snippets similarity index 100% rename from .vim/snipps/plaintex.snippets rename to vim/vim/snipps/plaintex.snippets diff --git a/.vim/snipps/tex.snippets b/vim/vim/snipps/tex.snippets similarity index 98% rename from .vim/snipps/tex.snippets rename to vim/vim/snipps/tex.snippets index a9b8af7..21f5884 100644 --- a/.vim/snipps/tex.snippets +++ b/vim/vim/snipps/tex.snippets @@ -1,11 +1,3 @@ -snippet s "symbol" -\\$0 -endsnippet - -snippet mb "Math Braces" -\\{ $1 \\}$0 -endsnippet - snippet mal "Math inline" $ $1 $$0 endsnippet @@ -30,6 +22,10 @@ snippet abs "Absolute" i \\lvert $1 \\rvert$0 endsnippet +snippet mb "Math Braces" +\\{ $1 \\}$0 +endsnippet + snippet fra "Fraction" i \frac\{${1:numerator}\}\{${2:demoninator}\}$0 endsnippet diff --git a/.vim/snipps/vim.snippets b/vim/vim/snipps/vim.snippets similarity index 69% rename from .vim/snipps/vim.snippets rename to vim/vim/snipps/vim.snippets index ad2afcc..82dfd1e 100644 --- a/.vim/snipps/vim.snippets +++ b/vim/vim/snipps/vim.snippets @@ -1,4 +1,5 @@ snippet plug "Plugin Snippet" -" $1 -Plugin '$0' +" $2 +Plug '$1' +$0 endsnippet diff --git a/vim/vim/snipps/vue.snippets b/vim/vim/snipps/vue.snippets new file mode 100644 index 0000000..7447bf0 --- /dev/null +++ b/vim/vim/snipps/vue.snippets @@ -0,0 +1,2 @@ +extends html + diff --git a/.vimrc b/vim/vimrc similarity index 86% rename from .vimrc rename to vim/vimrc index 056ec40..fd1211a 100644 --- a/.vimrc +++ b/vim/vimrc @@ -1,76 +1,69 @@ set nocompatible " required -filetype off " required " set the runtime path to include Vundle and initialize -set rtp+=~/.vim/bundle/Vundle.vim -call vundle#begin() - -" let Vundle manage Vundle, required -Plugin 'VundleVim/Vundle.vim' - -" add all your plugins here (note older versions of Vundle -" used Bundle instead of Plugin) +call plug#begin('~/.vim/bundle') " USEFUL " comment plugin -Plugin 'tpope/vim-commentary' +Plug 'tpope/vim-commentary' " brackets management -Plugin 'machakann/vim-sandwich' +Plug 'tpope/vim-surround' " snippets -Plugin 'SirVer/ultisnips' +Plug 'SirVer/ultisnips' " WINDOW MANAGEMENT " tmux navigator -Plugin 'christoomey/vim-tmux-navigator' +Plug 'christoomey/vim-tmux-navigator' " winresizer -Plugin 'simeji/winresizer' +Plug 'simeji/winresizer' " FILE MANAGEMENT " nert-tree -Plugin 'scrooloose/nerdtree' +Plug 'scrooloose/nerdtree' " fzf plugin -Plugin 'junegunn/fzf.vim' +Plug 'junegunn/fzf.vim' " GIT STUFF " git -Plugin 'tpope/vim-fugitive' +Plug 'tpope/vim-fugitive' " vim gitgutter -Plugin 'airblade/vim-gitgutter' +Plug 'airblade/vim-gitgutter' " COLORS -" color schemes -Plugin 'flazz/vim-colorschemes' +" Plastic colorscheme +Plug 'aonemd/kuroi.vim' " powerline -Plugin 'vim-airline/vim-airline' -Plugin 'vim-airline/vim-airline-themes' +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' " LANGUAGE SUPPORT " vim ale for interaction with language servers -Plugin 'w0rp/ale' +Plug 'w0rp/ale' " editorconfig plugin -Plugin 'editorconfig/editorconfig-vim' +Plug 'editorconfig/editorconfig-vim' " language packs -Plugin 'sheerun/vim-polyglot' +Plug 'sheerun/vim-polyglot' " latex -Plugin 'lervag/vimtex' +Plug 'lervag/vimtex' -" All of your Plugins must be added before the following line -call vundle#end() " required +call plug#end() " required filetype plugin indent on " required " syntax syntax on -colorscheme Benokai +colorscheme kuroi +set background=dark let mapleader=" " +hi MatchParen cterm=bold ctermbg=NONE ctermfg=red " random settings set number @@ -115,6 +108,9 @@ nnoremap t :tabnew nnoremap gT nnoremap gt +" search for visual selection +vnoremap // y/" + " Enable folding set foldmethod=indent set foldlevel=99 @@ -237,7 +233,7 @@ let g:airline_section_y = "" let g:airline_section_z = "%l/%L:%c" let g:airline_section_b = "%{airline#util#wrap(airline#extensions#branch#get_head(),0)}" " other stuff -let g:airline_theme='solarized' +let g:airline_theme='luna' let g:airline_solarized_bg='dark' let g:airline_powerline_fonts = 1 let g:airline_inactive_collapse=1 @@ -259,7 +255,7 @@ augroup END " fzf setup nmap :Buffers -nmap f :Files +nmap f :GFiles let g:fzf_buffers_jump = 1 " vim-ale setup