init mac setup

This commit is contained in:
Adam Jeniski 2022-11-04 16:24:38 -04:00
parent e035f71725
commit 3fa9216bef
7 changed files with 143 additions and 3160 deletions

View File

@ -41,6 +41,7 @@ Plug 'glepnir/dashboard-nvim'
Plug 'kshenoy/vim-signature'
Plug 'phaazon/hop.nvim'
Plug 'terrortylor/nvim-comment'
Plug 'dense-analysis/ale' -- async runtime for formatting
-- Git Integration
Plug 'airblade/vim-gitgutter'
@ -116,7 +117,7 @@ require('nvim_comment').setup()
-- setup dashboard
local home = os.getenv('HOME')
local db = require('dashboard')
db.preview_command = 'cat | lolcat -v 2'
db.preview_command = 'cat | lolcat -F .2'
db.preview_file_path = home .. '/.config/nvim/static/neovim.bold'
db.preview_file_height = 12
db.preview_file_width = 80
@ -430,6 +431,19 @@ dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close {}
end
-- formatting
vim.cmd[[let g:ale_fixers = {
\ 'javascript': ['prettier'],
\ 'typescript': ['prettier'],
\ 'css': ['prettier'],
\ 'svelte': ['prettier'],
\}]]
vim.cmd[[let g:ale_linters_explicit = 1]]
vim.cmd[[let g:ale_fix_on_save = 1]]
vim.cmd[[let g:ale_linters_ignore = {
\ 'typescript': ['eslint'],
\}]]
-- keymaps
local loud_opts = { noremap = true }
vim.keymap.set("n", "<c-s>", ":wa<cr>:echo 'File saved.'<cr>", loud_opts)

3
.vim/.gitignore vendored
View File

@ -1,3 +0,0 @@
plugged
colors

File diff suppressed because it is too large Load Diff

View File

@ -1,150 +0,0 @@
"""" Key Bindings
:nmap <F1> :echo<CR>
:imap <F1> <C-o>:echo<CR>
" move vertically by visual line (don't skip wrapped lines)
nmap j gj
nmap k gk
let mapleader = ' '
let maplocalleader = ' '
" save file bind
nnoremap <c-s> :w<cr>
inoremap <c-s> <esc>:w<cr>
" exit terminal mode
:tnoremap <Esc> <C-\><C-n>
" toggle relative number
function! ToggleLineNumber()
if &rnu == 1
set nornu
else
set rnu
endif
endfunction
nnoremap <leader>tr :call ToggleLineNumber()<CR>
" toggle Zen Mode
nnoremap <leader>tz :Goyo<CR>
" tree sitter text object key bindings
lua <<EOF
require'nvim-treesitter.configs'.setup {
textobjects = {
select = {
enable = true,
-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["ab"] = "@block.outer",
["ib"] = "@block.inner",
},
},
},
}
EOF
" remap keys for gotos
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)
" Use K to show documentation in preview window
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if CocAction('hasProvider', 'hover')
call CocActionAsync('doHover')
else
call feedkeys('K', 'in')
endif
endfunction
" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)
" Formatting selected code.
xmap <leader>f <Plug>(coc-format-selected)
" jump to next error
nnoremap <leader>EN <Plug>(coc-diagnostic-next)
nnoremap <leader>EB <Plug>(coc-diagnostic-prev)
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s).
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder.
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap keys for applying codeAction to the current buffer.
nmap <leader>ac <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
" ignore for ctrlp
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git\|target\|dist\|build'
" ignore for telescope
if has('nvim')
lua <<EOF
require('telescope').setup{ defaults = { file_ignore_patterns = {".git", "node_modules", "dist", "build", "DS_Store"} } }
EOF
endif
" Make <CR> auto-select the first completion item and notify coc.nvim to
" " format on enter, <cr> could be remapped by other vim plugin
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
inoremap <silent><expr> <tab> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" Use <c-space> to trigger completion.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
" transparent vim toggle bind
nnoremap <leader>tt :TransparentToggle<cr>
" prettier format bind
nnoremap <leader>P :PrettierAsync<cr>
" binds for swapping buffers
nnoremap gT :bp<cr>
nnoremap gt :bn<cr>
nnoremap <leader>h :wincmd h<cr>
nnoremap <leader>j :wincmd j<cr>
nnoremap <leader>k :wincmd k<cr>
nnoremap <leader>l :wincmd l<cr>
" format clojure
nnoremap <leader>F :AsyncRun! lein cljfmt fix<cr><cr>

View File

@ -1,97 +0,0 @@
call plug#begin('~/.vim/plugged')
" File Viewer
Plug 'scrooloose/nerdtree'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
"Plug 'ryanoasis/vim-devicons' " disable for git-bash (no emoji support)
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
" git wrapper
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
" status bar
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" theme
Plug 'ghifarit53/tokyonight-vim'
Plug 'EdenEast/nightfox.nvim'
Plug 'tribela/vim-transparent'
Plug 'junegunn/goyo.vim'
Plug 'arcticicestudio/nord-vim'
Plug 'dylanaraps/wal'
" editing extensions
Plug 'skywind3000/asyncrun.vim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-treesitter/nvim-treesitter-textobjects'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-repeat'
Plug 'preservim/nerdcommenter'
Plug 'prettier/vim-prettier', { 'do': 'yarn install --frozen-lockfile --production' }
Plug 'guns/vim-sexp'
Plug 'tpope/vim-sexp-mappings-for-regular-people'
Plug 'tpope/vim-dispatch'
Plug 'radenling/vim-dispatch-neovim'
Plug 'clojure-vim/vim-jack-in'
Plug 'luochen1990/rainbow'
Plug 'jiangmiao/auto-pairs'
" language support
Plug 'sheerun/vim-polyglot'
Plug 'jparise/vim-graphql'
Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'yarn install --frozen-lockfile'}
Plug 'evanleck/vim-svelte'
Plug 'pangloss/vim-javascript'
Plug 'HerringtonDarkholme/yats.vim'
Plug 'pantharshit00/vim-prisma'
Plug 'Olical/conjure'
Plug 'tpope/vim-fireplace'
" fuzzy file finder
Plug 'kien/ctrlp.vim'
call plug#end()
" airline settings
let g:airline_powerline_fonts = 1
let g:airline_theme='night_owl'
let g:airline_section_y = '%{strftime("%H:%M")}'
let g:airline#extensions#tabline#enabled = 1 " Enable the list of buffers
let g:airline#extensions#whitespace#enabled = 0
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" Enable rainbow parens
let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle
" powerline symbols
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = '☰'
let g:airline_symbols.maxlinenr = ''
let g:airline_symbols.dirty='⚡'
" ctrlp settings
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git\|build\|dist\|target'
" telescope settings
lua << EOF
require('telescope').setup{ defaults = { file_ignore_patterns = {
"node_modules",
".git",
"build",
"dist",
"target"
} } }
EOF

View File

@ -1,97 +0,0 @@
source ~/.vim/plugins.vim
source ~/.vim/keymaps.vim
"""" Basic Behavior
set number
set relativenumber
set wrap " wrap lines
set encoding=UTF-8 " set encoding to UTF-8 (default was "latin1")
set mouse=a " enable mouse support (might not work well on Mac OS X)
set wildmenu " visual autocomplete for command menu
set lazyredraw " redraw screen only when we need to
set showmatch " highlight matching parentheses / brackets [{()}]
set laststatus=2 " always show statusline (even with only single window)
set ruler " show line and column number of the cursor on right side of statusline
set visualbell " blink cursor on error, instead of beeping
set invlist " show tabs
""" Vim Appearance
syntax on
set t_Co=256
set cursorline
set termguicolors
let g:tokyonight_style = 'night' " available: night, storm
let g:tokyonight_enable_italic = 1
colorscheme nord
" colorscheme wal
" colorscheme nordfox
" colorscheme tokyonight
" colorscheme duskfox
" colorscheme nightfox
hi Normal guibg=NONE ctermbg=NONE
" turn on mouse mode
" use filetype-based syntax highlighting, ftplugins, and indentati
syntax enable
filetype plugin indent on
set foldmethod=indent
set foldlevel=10
" fix clipboard
" set clipboard=unnamed.unnamedplus
"""" Tab settings
set tabstop=4 " width that a <TAB> character displays as
set shiftwidth=4 " number of spaces to use for each step of (auto)indent
set softtabstop=4 " backspace after pressing <TAB> will remove up to this many spaces
set autoindent " copy indent from current line when starting a new line
set smartindent " even better autoindent (e.g. add indent after '{')
"""" Search settings
set incsearch " search as characters are entered
set hlsearch " highlight matches
" turn off search highlighting with <CR> (carriage-return)
nnoremap <CR> :nohlsearch<CR><CR>
"""" NerdTree Settings
let g:NERDTreeFileExtensionHighlightFullName = 1
let g:NERDTreeExactMatchHighlightFullName = 1
let g:NERDTreePatternMatchHighlightFullName = 1
let g:NerdTreeQuitOnOpen = 1
nnoremap <leader>n :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>
" Start NERDTree when Vim starts with a directory argument.
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') |
\ execute 'NERDTree' argv()[0] | wincmd p | enew | execute 'cd '.argv()[0] | endif
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
"""" Miscellaneous settings that might be worth enabling
set cursorline " highlight current line
set background=dark " configure Vim to use brighter colors
set autoread " autoreload the file in Vim if it has been changed outside of Vim

128
.zshrc Normal file
View File

@ -0,0 +1,128 @@
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="agnoster"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='nvim'
fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
alias shconfig="nvim ~/.zshrc"
alias ohmyzsh="nvim ~/.oh-my-zsh"
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
#setup dotfile aliases
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
#vim aliases
alias vim="nvim"
alias vi="nvim"
alias v="nvim"
#devleopment variables
TMUX_CONFIG="~/.config/tmux/.tmux.conf"
#development shortcuts
alias lg="lazygit"
alias tn="tmux -u -f $TMUX_CONFIG new"
alias ta="tmux -u -f $TMUX_CONFIG attach"
alias tl="tmux list-sessions"
alias o="rg --files . | fzf | xargs nvim"
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
export PATH="/opt/homebrew/opt/cython/bin:$PATH"