diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | .tmux.conf | 2 | ||||
-rw-r--r-- | .vim/colors/molokai.vim | 276 | ||||
-rwxr-xr-x[-rw-r--r--] | .vimrc | 236 | ||||
-rw-r--r-- | .zshrc | 35 | ||||
-rw-r--r-- | README.md | 10 |
6 files changed, 467 insertions, 93 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/.tmux.conf b/.tmux.conf index a69986c..84838bd 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -4,7 +4,7 @@ set -g repeat-time 250 set -sg escape-time 0 set -g status-bg colour235 -set -g status-fg colour245 +set -g status-fg colour249 set-window-option -g window-status-current-fg white bind '"' split-window -c "#{pane_current_path}" diff --git a/.vim/colors/molokai.vim b/.vim/colors/molokai.vim new file mode 100644 index 0000000..6d97053 --- /dev/null +++ b/.vim/colors/molokai.vim @@ -0,0 +1,276 @@ +" Vim color file +" +" Author: Tomas Restrepo <tomas@winterdom.com> +" https://github.com/tomasr/molokai +" +" Note: Based on the Monokai theme for TextMate +" by Wimer Hazenberg and its darker variant +" by Hamish Stuart Macpherson +" + +hi clear + +if version > 580 + " no guarantees for version 5.8 and below, but this makes it stop + " complaining + hi clear + if exists("syntax_on") + syntax reset + endif +endif +let g:colors_name="molokai" + +if exists("g:molokai_original") + let s:molokai_original = g:molokai_original +else + let s:molokai_original = 0 +endif + + +hi Boolean guifg=#AE81FF +hi Character guifg=#E6DB74 +hi Number guifg=#AE81FF +hi String guifg=#E6DB74 +hi Conditional guifg=#F92672 gui=bold +hi Constant guifg=#AE81FF gui=bold +hi Cursor guifg=#000000 guibg=#F8F8F0 +hi iCursor guifg=#000000 guibg=#F8F8F0 +hi Debug guifg=#BCA3A3 gui=bold +hi Define guifg=#66D9EF +hi Delimiter guifg=#8F8F8F +hi DiffAdd guibg=#13354A +hi DiffChange guifg=#89807D guibg=#4C4745 +hi DiffDelete guifg=#960050 guibg=#1E0010 +hi DiffText guibg=#4C4745 gui=italic,bold + +hi Directory guifg=#A6E22E gui=bold +hi Error guifg=#E6DB74 guibg=#1E0010 +hi ErrorMsg guifg=#F92672 guibg=#232526 gui=bold +hi Exception guifg=#A6E22E gui=bold +hi Float guifg=#AE81FF +hi FoldColumn guifg=#465457 guibg=#000000 +hi Folded guifg=#465457 guibg=#000000 +hi Function guifg=#A6E22E +hi Identifier guifg=#FD971F +hi Ignore guifg=#808080 guibg=bg +hi IncSearch guifg=#C4BE89 guibg=#000000 + +hi Keyword guifg=#F92672 gui=bold +hi Label guifg=#E6DB74 gui=none +hi Macro guifg=#C4BE89 gui=italic +hi SpecialKey guifg=#66D9EF gui=italic + +hi MatchParen guifg=#000000 guibg=#FD971F gui=bold +hi ModeMsg guifg=#E6DB74 +hi MoreMsg guifg=#E6DB74 +hi Operator guifg=#F92672 + +" complete menu +hi Pmenu guifg=#66D9EF guibg=#000000 +hi PmenuSel guibg=#808080 +hi PmenuSbar guibg=#080808 +hi PmenuThumb guifg=#66D9EF + +hi PreCondit guifg=#A6E22E gui=bold +hi PreProc guifg=#A6E22E +hi Question guifg=#66D9EF +hi Repeat guifg=#F92672 gui=bold +hi Search guifg=#000000 guibg=#FFE792 +" marks +hi SignColumn guifg=#A6E22E guibg=#232526 +hi SpecialChar guifg=#F92672 gui=bold +hi SpecialComment guifg=#7E8E91 gui=bold +hi Special guifg=#66D9EF guibg=bg gui=italic +if has("spell") + hi SpellBad guisp=#FF0000 gui=undercurl + hi SpellCap guisp=#7070F0 gui=undercurl + hi SpellLocal guisp=#70F0F0 gui=undercurl + hi SpellRare guisp=#FFFFFF gui=undercurl +endif +hi Statement guifg=#F92672 gui=bold +hi StatusLine guifg=#455354 guibg=fg +hi StatusLineNC guifg=#808080 guibg=#080808 +hi StorageClass guifg=#FD971F gui=italic +hi Structure guifg=#66D9EF +hi Tag guifg=#F92672 gui=italic +hi Title guifg=#ef5939 +hi Todo guifg=#FFFFFF guibg=bg gui=bold + +hi Typedef guifg=#66D9EF +hi Type guifg=#66D9EF gui=none +hi Underlined guifg=#808080 gui=underline + +hi VertSplit guifg=#808080 guibg=#080808 gui=bold +hi VisualNOS guibg=#403D3D +hi Visual guibg=#403D3D +hi WarningMsg guifg=#FFFFFF guibg=#333333 gui=bold +hi WildMenu guifg=#66D9EF guibg=#000000 + +hi TabLineFill guifg=#1B1D1E guibg=#1B1D1E +hi TabLine guibg=#1B1D1E guifg=#808080 gui=none + +if s:molokai_original == 1 + hi Normal guifg=#F8F8F2 guibg=#272822 + hi Comment guifg=#75715E + hi CursorLine guibg=#3E3D32 + hi CursorLineNr guifg=#FD971F gui=none + hi CursorColumn guibg=#3E3D32 + hi ColorColumn guibg=#3B3A32 + hi LineNr guifg=#BCBCBC guibg=#3B3A32 + hi NonText guifg=#75715E + hi SpecialKey guifg=#75715E +else + hi Normal guifg=#F8F8F2 guibg=#1B1D1E + hi Comment guifg=#7E8E91 + hi CursorLine guibg=#293739 + hi CursorLineNr guifg=#FD971F gui=none + hi CursorColumn guibg=#293739 + hi ColorColumn guibg=#232526 + hi LineNr guifg=#465457 guibg=#232526 + hi NonText guifg=#465457 + hi SpecialKey guifg=#465457 +end + +" +" Support for 256-color terminal +" +if &t_Co > 255 + if s:molokai_original == 1 + hi Normal ctermbg=234 + hi CursorLine ctermbg=235 cterm=none + hi CursorLineNr ctermfg=208 cterm=none + else + hi Normal ctermfg=252 ctermbg=233 + hi CursorLine ctermbg=234 cterm=none + hi CursorLineNr ctermfg=208 cterm=none + endif + hi Boolean ctermfg=135 + hi Character ctermfg=144 + hi Number ctermfg=135 + hi String ctermfg=144 + hi Conditional ctermfg=161 cterm=bold + hi Constant ctermfg=135 cterm=bold + hi Cursor ctermfg=16 ctermbg=253 + hi Debug ctermfg=225 cterm=bold + hi Define ctermfg=81 + hi Delimiter ctermfg=241 + + hi DiffAdd ctermbg=24 + hi DiffChange ctermfg=181 ctermbg=239 + hi DiffDelete ctermfg=162 ctermbg=53 + hi DiffText ctermbg=102 cterm=bold + + hi Directory ctermfg=118 cterm=bold + hi Error ctermfg=219 ctermbg=89 + hi ErrorMsg ctermfg=199 ctermbg=16 cterm=bold + hi Exception ctermfg=118 cterm=bold + hi Float ctermfg=135 + hi FoldColumn ctermfg=67 ctermbg=16 + hi Folded ctermfg=67 ctermbg=16 + hi Function ctermfg=118 + hi Identifier ctermfg=208 cterm=none + hi Ignore ctermfg=244 ctermbg=232 + hi IncSearch ctermfg=193 ctermbg=16 + + hi keyword ctermfg=161 cterm=bold + hi Label ctermfg=229 cterm=none + hi Macro ctermfg=193 + hi SpecialKey ctermfg=81 + + hi MatchParen ctermfg=233 ctermbg=208 cterm=bold + hi ModeMsg ctermfg=229 + hi MoreMsg ctermfg=229 + hi Operator ctermfg=161 + + " complete menu + hi Pmenu ctermfg=81 ctermbg=16 + hi PmenuSel ctermfg=255 ctermbg=242 + hi PmenuSbar ctermbg=232 + hi PmenuThumb ctermfg=81 + + hi PreCondit ctermfg=118 cterm=bold + hi PreProc ctermfg=118 + hi Question ctermfg=81 + hi Repeat ctermfg=161 cterm=bold + hi Search ctermfg=0 ctermbg=222 cterm=NONE + + " marks column + hi SignColumn ctermfg=118 ctermbg=235 + hi SpecialChar ctermfg=161 cterm=bold + hi SpecialComment ctermfg=245 cterm=bold + hi Special ctermfg=81 + if has("spell") + hi SpellBad ctermbg=52 + hi SpellCap ctermbg=17 + hi SpellLocal ctermbg=17 + hi SpellRare ctermfg=none ctermbg=none cterm=reverse + endif + hi Statement ctermfg=161 cterm=bold + hi StatusLine ctermfg=238 ctermbg=253 + hi StatusLineNC ctermfg=244 ctermbg=232 + hi StorageClass ctermfg=208 + hi Structure ctermfg=81 + hi Tag ctermfg=161 + hi Title ctermfg=166 + hi Todo ctermfg=231 ctermbg=232 cterm=bold + + hi Typedef ctermfg=81 + hi Type ctermfg=81 cterm=none + hi Underlined ctermfg=244 cterm=underline + + hi VertSplit ctermfg=244 ctermbg=232 cterm=bold + hi VisualNOS ctermbg=238 + hi Visual ctermbg=235 + hi WarningMsg ctermfg=231 ctermbg=238 cterm=bold + hi WildMenu ctermfg=81 ctermbg=16 + + hi Comment ctermfg=59 + hi CursorColumn ctermbg=236 + hi ColorColumn ctermbg=236 + hi LineNr ctermfg=250 ctermbg=236 + hi NonText ctermfg=59 + + hi SpecialKey ctermfg=59 + + if exists("g:rehash256") && g:rehash256 == 1 + hi Normal ctermfg=252 ctermbg=234 + hi CursorLine ctermbg=236 cterm=none + hi CursorLineNr ctermfg=208 cterm=none + + hi Boolean ctermfg=141 + hi Character ctermfg=222 + hi Number ctermfg=141 + hi String ctermfg=222 + hi Conditional ctermfg=197 cterm=bold + hi Constant ctermfg=141 cterm=bold + + hi DiffDelete ctermfg=125 ctermbg=233 + + hi Directory ctermfg=154 cterm=bold + hi Error ctermfg=222 ctermbg=233 + hi Exception ctermfg=154 cterm=bold + hi Float ctermfg=141 + hi Function ctermfg=154 + hi Identifier ctermfg=208 + + hi Keyword ctermfg=197 cterm=bold + hi Operator ctermfg=197 + hi PreCondit ctermfg=154 cterm=bold + hi PreProc ctermfg=154 + hi Repeat ctermfg=197 cterm=bold + + hi Statement ctermfg=197 cterm=bold + hi Tag ctermfg=197 + hi Title ctermfg=203 + hi Visual ctermbg=238 + + hi Comment ctermfg=244 + hi LineNr ctermfg=239 ctermbg=235 + hi NonText ctermfg=239 + hi SpecialKey ctermfg=239 + endif +end + +" Must be at the end, because of ctermbg=234 bug. +" https://groups.google.com/forum/#!msg/vim_dev/afPqwAFNdrU/nqh6tOM87QUJ +set background=dark diff --git a/.vimrc b/.vimrc index 867eebf..7039c60 100644..100755 --- a/.vimrc +++ b/.vimrc @@ -1,107 +1,163 @@ -" vim-sublime - A minimal Sublime Text - like vim experience bundle -" http://github.com/grigio/vim-sublime -" Best view with a 256 color terminal and Powerline fonts -" Updated by Dorian Neto (https://github.com/dorianneto)" +" ~nebula/.vimrc (2018-2023, public domain) +" table of contents: +" <INI> setup +" <VIM> vim settings +" <PLG> plugins +" <LNG> language-specific behavior + +" <INI> setup ------------------------------------ + +" initialization stuff set nocompatible +set encoding=utf-8 +" plugin management execute pathogen#infect() - -filetype off set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' Plugin 'airblade/vim-gitgutter' -Plugin 'chrisbra/NrrwRgn' -Plugin 'colors' +Plugin 'tpope/vim-sleuth' +Plugin 'eslint/eslint' call vundle#end() -filetype plugin indent on -set background=dark +" <VIM> vim settings ----------------------------- + +" indentation & wrapping +set tabstop=4 shiftwidth=4 expandtab +set autoindent +set nosmartindent " also overridden per language +set smarttab shiftround +set nowrap +set linebreak +set breakindent +set showbreak=\ ↳\ " + +" editor behavior +filetype indent off +set autoread +set hidden +set backspace=indent,eol,start +set mouse=a ttymouse=xterm2 +set ttimeout ttimeoutlen=50 + +" editor appearance colorscheme molokai -let g:airline_theme='badwolf' -syntax on - -" Use :help 'option' to see the documentation for the given option. -set autoindent -set backspace=indent,eol,start -set showmatch -set showmode -set smarttab -set shiftround -set ttimeout -set ttimeoutlen=50 -set nois -set laststatus=2 -set ruler -set showcmd -set wildmenu -set autoread -set encoding=utf-8 -set tabstop=2 shiftwidth=2 expandtab -set listchars=tab:▒░,trail:▓ -set list -set number -set hlsearch -set ignorecase -set smartcase - -if has('mouse') - set mouse=a -endif - -set hidden -set nobackup -set nowritebackup -set noswapfile -set fileformats=unix,dos,mac -set completeopt=longest - -" -" Plugins config -" - -" NERDTree -nnoremap <S-n> :NERDTreeToggle<CR> - -" vim-airline -let g:airline#extensions#tabline#enabled = 1 -let g:airline_powerline_fonts = 1 +syntax off +set background=dark +set colorcolumn=+1 +set cursorline +set laststatus=2 +set list listchars=trail:▓ +set number +set scrolloff=5 sidescrolloff=8 +set showcmd +set noshowmode " airline shows mode already +set wildmenu -" -" Basic shortcuts definitions -" most in visual mode / selection (v or ⇧ v) -" - -" Find -map <C-f> / -" indent / deindent after selecting the text with (⇧ v), (.) to repeat. -vnoremap <Tab> > -vnoremap <S-Tab> < -" Text wrap simpler, then type the open tag or '," -vmap <C-w> S -" Tabs -let g:airline#extensions#tabline#enabled = 1 -nnoremap <C-Left> :tabprevious<CR> -inoremap <C-Left> <Esc>:tabprevious<CR>i -nnoremap <C-Right> :tabnext<CR> -inoremap <C-Right> <Esc>:tabnext<CR>i -nnoremap <C-t> :tabnew<CR> -inoremap <C-t> <Esc>:tabnew<CR>i - -set ttymouse=xterm2 -set mouse=a -set encoding=utf-8 -nnoremap <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR> -inoremap <C-s> <C-o>:w<CR> +" search +set hlsearch +set ignorecase smartcase +set noincsearch + +" writing behavior +set nobackup nowritebackup noswapfile +set fileformats=unix,dos,mac + +" keyboard shortcuts +nnoremap <C-f> / nnoremap <C-s> :w<CR> -command! -range=% Paste <line1>,<line2>!tee /tmp/paste /dev/stdout; curl -s --data-binary @/tmp/paste https://paste.safe.moe/documents | sed -r 's$.*".*".*"(.*)".*$https://paste.safe.moe/raw/\1$g' | xclip -sel clip +inoremap <C-s> <C-o>:w<CR> + +" restore previous scroll position +autocmd BufReadPost * silent! normal! g`"zv + +" disable default language-specific indentation behavior +" (this doesn't actually work as an autocmd, instead copy-paste +" this into ~/.vim/indent/<filetype>.vim files) +" let b:did_indent = 1 + +" only allow a few syntax highlighting colors +hi NonText ctermbg=NONE ctermfg=NONE cterm=NONE +hi Visual ctermbg=fg ctermfg=bg cterm=NONE +hi Boolean ctermbg=NONE ctermfg=NONE cterm=NONE +hi Character ctermbg=NONE ctermfg=NONE cterm=NONE +hi Comment ctermbg=NONE ctermfg=45 cterm=NONE +hi Conditional ctermbg=NONE ctermfg=NONE cterm=NONE +hi Constant ctermbg=NONE ctermfg=NONE cterm=NONE +hi Delimiter ctermbg=NONE ctermfg=NONE cterm=NONE +hi Error ctermbg=NONE ctermfg=NONE cterm=reverse +hi Exception ctermbg=NONE ctermfg=NONE cterm=NONE +hi Float ctermbg=NONE ctermfg=NONE cterm=NONE +hi Function ctermbg=NONE ctermfg=NONE cterm=NONE +hi Identifier ctermbg=NONE ctermfg=NONE cterm=NONE +hi Ignore ctermbg=NONE ctermfg=NONE cterm=NONE +hi Keyword ctermbg=NONE ctermfg=NONE cterm=NONE +hi Label ctermbg=NONE ctermfg=NONE cterm=NONE +hi Number ctermbg=NONE ctermfg=NONE cterm=NONE +hi Operator ctermbg=NONE ctermfg=NONE cterm=NONE +hi PreProc ctermbg=NONE ctermfg=NONE cterm=NONE +hi Repeat ctermbg=NONE ctermfg=NONE cterm=NONE +hi Special ctermbg=NONE ctermfg=NONE cterm=NONE +hi SpecialChar ctermbg=NONE ctermfg=NONE cterm=NONE +hi Statement ctermbg=NONE ctermfg=NONE cterm=NONE +hi StorageClass ctermbg=NONE ctermfg=NONE cterm=NONE +hi String ctermbg=NONE ctermfg=NONE cterm=NONE +hi Title ctermbg=NONE ctermfg=NONE cterm=NONE +hi Todo ctermbg=NONE ctermfg=DarkGray cterm=underline +hi Type ctermbg=NONE ctermfg=NONE cterm=NONE +hi Underlined ctermbg=NONE ctermfg=DarkGray cterm=underline +hi Search ctermbg=DarkGray ctermfg=white cterm=NONE +hi link gitcommitOverflow Error +hi htmlItalic ctermbg=NONE ctermfg=NONE cterm=underline + +" <PLG> plugin settings -------------------------- + +" airline +" let g:airline_theme='minimalist' +let g:airline_theme='zenburn' +" distinguished (grey yellow) +" peaksea (grey) +" molokai (molokai) +" minimalist (nice) +" luna (wof) +" zenburn (grey good contrast) +let g:airline_powerline_fonts = 1 +let g:airline#extensions#tabline#enabled = 1 + +" ale + +" Only lint if .eslintrc is present +autocmd BufEnter,BufNew *.js let g:ale_linters = FindGlob('.eslintrc.*', expand('%:p:h')) ? {'javascript': ['eslint']} : {'javascript': ['']} + +function! g:FindGlob(pattern, path) + let fullpattern = a:path . "/" . a:pattern + if strlen(glob(fullpattern)) + return 1 + else + let parts = split(a:path, "/") + if len(parts) + let newpath = "/" . join(parts[0:-2], "/") + return FindGlob(a:pattern, newpath) + else + return 0 + endif + endif +endfunction + +" <LNG> language specific behavior --------------- + +" indent options for particular languages +autocmd FileType javascript set smartindent +autocmd FileType c,cpp,h,hpp set smartindent +" word wrap javascript comments +autocmd BufEnter,BufNew *.js autocmd CursorMoved,CursorMovedI * :if match(getline('.'), '^\s*//') == 0 | :setlocal textwidth=80 | :else | :setlocal textwidth=0 | :endif -" AAAAAAAAAAAAAAAAAA todo highlighting -highlight TodoDone ctermfg=13 -highlight TodoNotDone ctermfg=15 -highlight TodoStringDone ctermfg=3 -highlight TodoStringNotDone ctermfg=2 cterm=bold +" yaml overrides +au FileType yaml setlocal indentexpr= +au FileType yaml nmap <buffer> { ?---\+<CR> +au FileType yaml nmap <buffer> } /---\+<CR> diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..fb965f5 --- /dev/null +++ b/.zshrc @@ -0,0 +1,35 @@ +# ~nebula/.zshrc, 2023 edition + + +# //// zsh configuration //////////////////////////////////////////////////// # + +if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + autoload -U colors && colors + PS1=$'\e[0;32;1m%n\e[0;32m@\e[32;1m%m \e[34m%1~ \e[0m%# ' + PROMPT="%F{green}%B%n%b@%B%m %F{blue}%1~%b%f %# " +else + PS1=$'%n@%m %1~ %# ' +fi + + +# //// third party configuration //////////////////////////////////////////// # + +# -- GPG -- + +export GPG_TTY=$(tty) + +# -- Homebrew -- + +eval "$(/opt/homebrew/bin/brew shellenv)" + +# -- Node Version Manager -- + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" + +# -- Python -- + +path+=("$HOME/Library/Python/3.9/bin") +path+=("/Applications/Sublime Text.app/Contents/SharedSupport/bin") +export PATH diff --git a/README.md b/README.md index e28cecd..efa8737 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ -I am very lazy and do not want to rewrite everything all the time so here is my tmux config (and maybe other things). +I'm very lazy and move between computers somewhat regularly, so here are my various, hopefully portable configuration files! Everything I've written here is public domain (insofar as it's cobbled together from the internet's knowledge en masse), so feel free to steal and use to your heart's content. -You'll want to source bash_either in bashrc or bash_profile or both or neither. You do you. +My personal setup for actually using this repo is approximately: + +1. Clone this repo somewhere that's gonna be readily accessible for quick edits. This is generally under my actual projects directory, e.g. ~/Local Workspace/Projects/dotfiles or ~/me/projects/cli/dotfiles or whatever. + +2. Symlink the repository into ~/.dotfiles so it's effectively kept in one consistent place and I can always access it there, even if I move the main project folder somewhere else (in which case I just update the ~/.dotfiles symlink). + +3. Symlink individual config files as needed, e.g. ~/.zshrc -> ~/.dotfiles/.zshrc which gets expanded to ~/Local Workspace/Projects/dotfiles/.zshrc. Yay! |