This commit is contained in:
Daniel Flanagan 2020-01-20 11:40:26 -06:00
parent f44d0d5479
commit f2a5060e7d
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
9 changed files with 61 additions and 99 deletions

13
apps/elixir/iex.exs Normal file
View file

@ -0,0 +1,13 @@
Application.put_env(:elixir, :ansi_enabled, true)
IEx.configure(
colors: [enabled: true],
default_prompt: [
"\e[G", # ANSI CHA, move cursor to column 1
:magenta,
"%prefix", # IEx prompt variable
">", # plain string
:reset
] |> IO.ANSI.format |> IO.chardata_to_string
)

View file

@ -31,3 +31,5 @@ color12 #a59f85
color13 #f5f4f1
color14 #cc6633
color15 #f9f8f5
color18 #333333

View file

@ -124,7 +124,11 @@ nnoremap <leader>j :bprevious<CR>
nnoremap <C-k> :bnext<CR>
nnoremap <C-j> :bprevious<CR>
nnoremap <leader>r :source ~/.config/nvim/init.vim<CR>
if has('nvim')
nnoremap <leader>r :source $vimdir/init.vim<CR>
else
nnoremap <leader>r :source $HOME/.vimrc<CR>
endif
" change buffers with leader,tab
nnoremap <leader><Tab> :bnext<CR>

View file

@ -1,56 +1,25 @@
" vim compatibility
let $vimdir = $HOME.'/.vim'
if has('nvim')
let $vimdir = $HOME.'/.config/nvim'
let $vimdir = $XDG_CONFIG_HOME.'/nvim'
endif
" utf8 encoding
if has('vim_starting')
set encoding=utf8
endif
" os detection functions
silent function! OSX()
return has('macunix')
endfunction
silent function! LINUX()
return has('unix') && !has('macunix') && !has('win32unix')
endfunction
silent function! WINDOWS()
return (has('win32') || has('win64'))
endfunction
" load a per-environment file if one exists
if filereadable(expand('$HOME/.env_init.vim'))
source "$HOME/.env_init.vim"
if filereadable("$ENV_PATH/vim")
source "$ENV_PATH/vim"
endif
" initialize plugin manager
if has('nvim')
call plug#begin('~/.config/nvim/bundle')
else
call plug#begin('~/.vim/bundle')
endif
let pluginsfile=$vimdir.'/plugins.vim'
exec 'source ' . pluginsfile
call plug#begin($vimdir.'/bundle')
source $vimdir/plugins.vim
call plug#end()
filetype on
filetype indent on
filetype plugin on
let settingsfile=$vimdir.'/settings.vim'
exec 'source ' . settingsfile
source $vimdir/settings.vim
source $vimdir/commands.vim
source $vimdir/bindings.vim
let commandsfile=$vimdir.'/commands.vim'
exec 'source ' . commandsfile
let bindingsfile=$vimdir.'/bindings.vim'
exec 'source ' . bindingsfile
" load a per-environment file if one exists
if filereadable(expand('$HOME/.env_init_after.vim'))
source "$HOME/.env_init_after.vim"
if filereadable("$ENV_PATH/vim-after")
source "$ENV_PATH/vim-after"
endif

View file

@ -1,25 +1,15 @@
" install plugin manager if needed
augroup PluginManagerInstaller
if has('nvim')
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
if empty(glob("$vimdir/autoload/plug.vim"))
silent !curl -fLo "$vimdir/autoload/plug.vim" --create-dirs 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall
endif
else
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall
endif
end
augroup End
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1 " automatically displays all buffers when there's only one tab open
let g:airline#extensions#tabline#fnamemod = ':t'
" set laststatus=2 " always show statusline
" set noshowmode " hides default mode
" cleanup/simplify airline
let g:airline#extensions#tabline#left_sep = ''
let g:airline#extensions#tabline#left_alt_sep = ''
let g:airline_right_alt_sep = ''
@ -28,7 +18,6 @@ let g:airline_left_alt_sep= ''
let g:airline_left_sep = ''
let g:airline#extensions#tabline#buffers_label = ''
" short mode texts
let g:airline_mode_map = {
\ '__' : '-',
\ 'n' : 'N',
@ -47,21 +36,9 @@ let g:airline_mode_map = {
let g:indent_guide_auto_colors = 1
let g:indent_guides_enable_on_vim_startup = 1
let g:prosession_dir = $vimdir."/session/"
" no ALE gutter
" let g:ale_sign_column_always = 0
" let g:ale_set_signs = 0
" highlight clear ALEErrorSign
" highlight clear ALEWarningSign
" fix me, baby
" let g:ale_fix_on_save = 1
" autocomplete
" let g:ale_completion_enabled = 1
" let g:ale_typescript_tslint_use_global = 1
let g:fzf_layout = { 'window': 'enew' }
" let g:fzf_layout = { 'window': 'enew' }
" check if we're using vim as the manpage viewer before loading session plugins
if exists('asmanviewer')
@ -69,14 +46,12 @@ if exists('asmanviewer')
else
Plug 'tpope/vim-obsession' " session ease-of-use
Plug 'dhruvasagar/vim-prosession' " more session ease-of-use
let g:prosession_dir = '~/.config/nvim/session/'
endif
Plug 'junegunn/vim-plug' " plugin manager should manage itself
Plug 'vim-airline/vim-airline' " status line
Plug 'vim-airline/vim-airline-themes' " more minimal status line
Plug 'nathanaelkane/vim-indent-guides' " indentation guides
" Plug 'w0rp/ale' " syntax checker
Plug 'SirVer/ultisnips' " snippet manager
Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all'} " fuzzy file finding
Plug 'junegunn/fzf.vim' " helpers for using fzf in vim
@ -101,16 +76,18 @@ Plug 'editorconfig/editorconfig-vim' " loads project-
Plug 'sheerun/vim-polyglot' " vim plugin loader for many languages
Plug 'leafo/moonscript-vim', {'for': ['moon', 'moonscript']} " moonscript language
Plug 'OmniSharp/omnisharp-vim', {'for': ['cs']} " C# language
" Plug 'junegunn/vim-peekaboo' " preview registers
Plug 'scrooloose/nerdtree' " file browser
Plug 'tpope/vim-eunuch' " unix helper commands
" Plug 'junegunn/vim-peekaboo' " preview registers
" language support
Plug 'sheerun/vim-polyglot' " vim plugin loader for many languages
Plug 'leafo/moonscript-vim', {'for': ['moon', 'moonscript']} " moonscript language
Plug 'OmniSharp/omnisharp-vim', {'for': ['cs']} " C# language
Plug 'neoclide/coc.nvim', {'branch': 'release'} " language server completion
Plug 'JakeBecker/elixir-ls', {'for': ['elixir', 'eelixir'], 'do': { -> g:elixirls.compile() }}
Plug 'tpope/vim-dadbod' " databasing in vim
Plug 'lytedev/elm-vim' " elm lang
Plug 'google/vim-jsonnet' " jsonnet
Plug 'sirtaj/vim-openscad' " openscad
Plug 'ssh://git@git.lyte.dev:2222/lytedev/vim-lytlang.git'
Plug 'tpope/vim-dadbod' " vim
Plug 'lytedev/elm-vim', {'for': ['elm']} " elm lang
Plug 'google/vim-jsonnet', {'for': ['jsonnet', 'libsonnet']} " jsonnet
Plug 'sirtaj/vim-openscad', {'for': ['scad']} " openscad
" Plug 'ssh://git@git.lyte.dev:2222/lytedev/vim-lytlang.git'

View file

@ -1,4 +1,5 @@
scriptencoding utf8
set encoding=utf8
" ALE completeopt recommendation
set completeopt=menu,menuone,preview,noselect,noinsert
@ -90,8 +91,8 @@ if has('autocmd')
endif
" color scheme
let base16colorspace=16
let &t_Co=16
let base16colorspace=256
let &t_Co=256
set background=dark
syntax enable
colorscheme base16-donokai

View file

@ -4,9 +4,9 @@ set -g prefix C-s
bind-key s send-prefix
# reload tmux.conf
bind-key T source-file ~/.tmux.conf \; display-message "source-file done"
bind-key T source-file "$HOME/.tmux.conf" \; display-message "source-file done"
unbind r
bind r source-file ~/.tmux.conf
bind r source-file "$HOME/.tmux.conf"
set -as terminal-overrides ',xterm*:smxx=\E[9m'
@ -46,7 +46,7 @@ bind-key j switch-client -p
bind-key h switch-client -p
bind-key k switch-client -n
bind-key l switch-client -n
bind s run-shell "tmux new-window 'sh -c ~/.config/dotfiles/bin/tmuxswitcher'"
bind s run-shell "tmux new-window tmuxswitcher"
# reset the working directory of the current session
bind-key P attach-session -t . -c '#{pane_current_path}' \; display-message 'Reset session dir to #{pane_current_path}'
@ -60,9 +60,9 @@ set -g status-interval 5
set -g status-right-length 80
set -g status-right "#[fg=colour4]#W#[fg=default]#[bg=default] #H"
set -g status-left-length 200
set -g status-left "#[fg=colour7]#(~/.config/dotfiles/bin/tmux-session-list #S)"
set -g status-left "#[fg=colour7]#(tmux-session-list #S)"
bind-key O run-shell "~/.config/dotfiles/bin/tmux-save-buffer #S" \; display-message "Saved buffer to ~/<date>.<session-name>.tmux-buffer.log"
bind-key O run-shell "tmux-save-buffer #S" \; display-message "Saved buffer to ~/<date>.<session-name>.tmux-buffer.log"
# pane split line colors
set -g pane-active-border-style bg=black,fg=blue
@ -135,7 +135,7 @@ set -g @resurrect-save 'C-v'
set -g @resurrect-restore 'R'
# initialize tmux plugin manager
run '~/.tmux/plugins/tpm/tpm'
run '$HOME/.tmux/plugins/tpm/tpm'
# attempt at integrating nested tmux sessions nicely
# bind -T root F12 \

View file

@ -1,15 +1,8 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
# our vim config is setup to not auto-load sessions if we set the
# `asmanviewer` variable, so launch vim that way when using vim as our man
# page viewer
if command -v nvim >/dev/null 2>&1; then
nvim --cmd "let asmanviewer=1" -c "SuperMan $*"
else
vim --cmd "let asmanviewer=1" -c "SuperMan $*"
fi
# proper error handling
if [ "$?" != "0" ]; then
echo "No manual entry for $*"
fi
vim --cmd "let asmanviewer=1" -c "SuperMan $*"
[ "$?" != "0" ] && echo "No manual entry for $*" && exit 1

View file

@ -35,7 +35,7 @@ links=(
# shell files
"$dfp/apps/shell/bash/rc" "$HOME/.bashrc"
"$dfp/apps/shell/bash/profile" "$HOME/.bash_profile"
"$dfp/apps/shell/tmux/tmux.conf" "$HOME/.tmux.conf"
"$dfp/apps/shell/tmux/conf" "$HOME/.tmux.conf"
"$dfp/apps/shell/tmux/layouts" "$HOME/.tmux/layouts"
"$dfp/apps/shell/fish/" "$XDG_CONFIG_HOME/fish"
@ -100,6 +100,9 @@ links=(
# fontconfig
"$dfp/apps/de/fontconfig/" "$XDG_CONFIG_HOME/fontconfig"
# fontconfig
"$dfp/apps/elixir/iex.exs" "$HOME/.iex.exs"
# XDG user directories
"$dfp/apps/shell/user-dirs" "$XDG_CONFIG_HOME/user-dirs.dirs"
)