Skip to content

Instantly share code, notes, and snippets.

@ahmubashshir
Forked from audacioustux/.alacritty.yml
Created June 16, 2020 17:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmubashshir/ed22a0395134995a8c9bc816bc591c5e to your computer and use it in GitHub Desktop.
Save ahmubashshir/ed22a0395134995a8c9bc816bc591c5e to your computer and use it in GitHub Desktop.
dot.rc @audacioustux - #starship #alacritty #asdf #vim #kitty #zsh
window:
dynamic_padding: true
decorations: none
startup_mode: Fullscreen
font:
normal:
family: Source Code Pro
style: SemiBold
bold:
family: Source Code Pro
style: Bold
italic:
family: Source Code Pro
style: Italic
bold_italic:
family: Source Code Pro
style: Bold Italic
size: 9.0
draw_bold_text_with_bright_colors: true
colors:
primary:
background: '#272822'
foreground: '#F8F8F2'
normal:
black: '#272822'
red: '#F92672'
green: '#A6E22E'
yellow: '#F4BF75'
blue: '#66D9EF'
magenta: '#AE81FF'
cyan: '#A1EFE4'
white: '#F8F8F2'
bright:
black: '#75715E'
red: '#F92672'
green: '#A6E22E'
yellow: '#F4BF75'
blue: '#66D9EF'
magenta: '#AE81FF'
cyan: '#A1EFE4'
white: '#F9F8F5'
background_opacity: 0.95
live_config_reload: true
hide_when_typing: true
alias ls='ls -G'
alias zshreload='source ~/.zshrc' # reload ZSH
alias shtop='sudo htop' # run `htop` with root rights
alias grep='grep --color=auto' # colorize `grep` output
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias less='less -R'
alias g='git'
alias rm='rm -i' # confirm removal
alias cp='cp -i' # confirm copy
alias mv='mv -i' # confirm move
export EDITOR=/usr/bin/nano
# add go path
export GOPATH=$(go env GOPATH)
export PATH="$PATH:${GOPATH//://bin:}/bin"
# add cargo path
export PATH="$HOME/.cargo/bin:$PATH"
# add npm path
export PATH=$PATH:$HOME/.npm-global/bin
# add nvm path
export NVM_DIR="$HOME/.nvm"
# escripts
export PATH=$PATH:$HOME/.mix/escripts
eval "$(starship init zsh)"
source $HOME/.profile
source $HOME/.zsh/history.zsh # 'history' config
source $HOME/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh # syntax highlighting
source $HOME/.zsh/completion.zsh # auto completion
source $HOME/.asdf/asdf.sh
# asdf asdf-vm.com
fpath=(${ASDF_DIR}/completions $fpath)
# Initialize the completion system
autoload -Uz compinit
# Cache completion if nothing changed - faster startup time
typeset -i updated_at=$(date +'%j' -r ~/.zcompdump 2>/dev/null || stat -f '%Sm' -t '%j' ~/.zcompdump 2>/dev/null)
if [ $(date +'%j') != $updated_at ]; then
compinit -i
else
compinit -C -i
fi
# Enhanced form of menu completion called `menu selection'
zmodload -i zsh/complist
source $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh # auto suggestion
# nvm
# [ -s "$NVM_DIR/nvm.sh" ] && source $HOME/.zsh/nvm.zsh
source $HOME/.zsh/key-bindings.zsh # key bindings
# alias
source $HOME/.aliases.zsh
# Completion for kitty
kitty + complete setup zsh | source /dev/stdin
mkdir ~/.npm-global
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
nvm alias default system
cd ~/.zsh && wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/lib/key-bindings.zsh
cd ~/.zsh && wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/lib/history.zsh
cd ~/.zsh && git clone https://github.com/zsh-users/zsh-autosuggestions.git
cd ~/.zsh && git clone https://github.com/zdharma/fast-syntax-highlighting
curl -fsSL https://starship.rs/install.sh | bash

things visible in terminal: kitty, starship, nvm, bat, neofetch, lolcat, cowsay

Kde configs:

  • global theme: breeze dark
  • plasma style: Materia Blur Mono
  • gtk2/3 theme: breath-dark (prefer dark)
  • icon: papirus-dark-maia cursor: bibata_oil
function! conf#before() abort
:imap ii <Esc>
endfunction
function! conf#after() abort
augroup fmt
autocmd!
autocmd BufWrite * silent! Neoformat
augroup END
endfunction
# ~/.SpaceVim.d/init.toml
#=============================================================================
# dark_powered.toml --- dark powered configuration example for SpaceVim
# Copyright (c) 2016-2017 Wang Shidong & Contributors
# Author: Wang Shidong < wsdjeg at 163.com >
# URL: https://spacevim.org
# License: GPLv3
#=============================================================================
# All SpaceVim option below [option] section
[options]
automatic_update = true
# set spacevim theme. by default colorscheme layer is not loaded,
# if you want to use more colorscheme, please load the colorscheme
# layer
colorscheme = "gruvbox"
colorscheme_bg = "dark"
# Disable guicolors in basic mode, many terminal do not support 24bit
# true colors
enable_guicolors = true
# Disable statusline separator, if you want to use other value, please
# install nerd fonts
statusline_separator = "fire"
statusline_inactive_separator = "arrow"
buffer_index_type = 4
enable_tabline_filetype_icon = true
enable_statusline_mode = false
# enable file tree git status
enable_vimfiler_gitstatus = true
lint_on_the_fly = true
bootstrap_before = "conf#before"
bootstrap_after = "conf#after"
# Enable autocomplete layers
[[layers]]
name = "autocomplete"
auto_completion_return_key_behavior = "smart"
# auto_completion_tab_key_behavior = "smart"
auto_completion_delay = 20
[[layers]]
name = 'shell'
default_position = 'bottom'
default_height = 30
[[layers]]
name = "lang#rust"
format-autosave = true
recommended-style = true
[[layers]]
name = "denite"
[[layers]]
name = "lsp"
filetypes = [
"rust",
"css",
"html",
"c",
"cpp",
"typescript",
"javascript",
"vue",
"css"
]
[layers.override_cmd]
rust = ["rls"]
[[layers]]
name = "tools"
[[layers]]
name = "default"
[[layers]]
name = "lang#html"
[[layers]]
name = "lang#markdown"
[[layers]]
name = "lang#elixir"
[[layers]]
name = "lang#c"
[[layers]]
name = "lang#typescript"
[[layers]]
name = "lang#javascript"
[[layers]]
name = "lang#vue"
" install vim-plug if needed.
if empty(glob('~/.local/share/nvim/site/autoload/plug.vim'))
silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source ~/.config/nvim/init.vim
endif
" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin(stdpath('config').'/plugged')
" Make sure you use single quotes
" elixir
Plug 'elixir-editors/vim-elixir'
Plug 'elixir-lsp/elixir-ls', { 'do': { -> g:ElixirLS.compile() } }
" language server protocol (lsp)
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" statusline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" theme
Plug 'morhetz/gruvbox'
" vertical lines at each indentation level
Plug 'Yggdroot/indentLine'
" comment manipulation
Plug 'preservim/nerdcommenter'
" fzf - fuzzy search
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
" file system / tree explorer
Plug 'preservim/nerdtree'
" icons
Plug 'ryanoasis/vim-devicons'
" git
Plug 'tpope/vim-fugitive'
Plug 'junegunn/gv.vim'
Plug 'airblade/vim-gitgutter'
" tags
Plug 'majutsushi/tagbar'
" Surround.vim is all about 'surroundings': parentheses, brackets, quotes, XML tags, and more
Plug 'tpope/vim-surround'
" multiple cursor
Plug 'terryma/vim-multiple-cursors'
" rust
Plug 'rust-lang/rust.vim'
" emmet
Plug 'mattn/emmet-vim'
" undo tree
Plug 'simnalamburt/vim-mundo'
" move line/selection left/right up/down
Plug 'matze/vim-move'
" just to solve disappearing quotes in json because of indentLines plug [patch-1]
Plug 'elzr/vim-json'
" fancy start screen
Plug 'mhinz/vim-startify'
" Initialize plugin system
call plug#end()
" the prefix to use for leader commands
let mapleader=" "
" switches to absolute line numbers automatically when relative numbers don't make sense.
set number relativenumber
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu | set rnu | endif
autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif
augroup END
" toggle line number mode
nnoremap <silent> <F7> :set relativenumber!<cr>
" enable highlighting of the current cursor position
" set cursorline
" set cursorcolumn
" set syntax theme
syntax on
set termguicolors " try `:set notermguicolors` for comparison
colorscheme gruvbox
set background=dark
" gruvbox clearly not good as airline theme
let g:airline_theme='simple'
" set column guide
set textwidth=80
set colorcolumn=+1
" reduce travel time to reach <Esc> key
imap kj <Esc>
imap jk <Esc>
" set mouse mode
set mouse=a
" bind to system clipboard (install xclip, see :h clipboard)
set clipboard+=unnamedplus
" keep block cursor on insert mode
set guicursor=
" don't highlight all matched
set nohlsearch
" Make searching case insensitive
set ignorecase
" ... unless the query has capital letters.
set smartcase
" keep hlsearch while searching
set incsearch
augroup incsearchHighlight
autocmd!
autocmd CmdlineEnter /,\? :set hlsearch
autocmd CmdlineLeave /,\? :set nohlsearch
augroup END
" keep the cursor a bit far than the edges (bottom & top) always
set scrolloff=10
" turn on spellcheck for comments
set spell spelllang=en
" no temp shits
set nobackup
set noswapfile
" indent related shits
set smartindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
" show hidden characters
set list
set listchars=tab:→\ ,space:·,nbsp:␣,trail:•,precedes:«,extends:»
"""""""""""""""""""""""""""""
" Coc - lsp
""""""""""""""""""""""""""""""""
let g:coc_global_extensions = ['coc-elixir', 'coc-diagnostic', 'coc-json', 'coc-rls', "coc-pairs"]
" TextEdit might fail if hidden is not set.
set hidden
" Some servers have issues with backup files, see #649.
set nobackup
set nowritebackup
" Give more space for displaying messages.
set cmdheight=2
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
" delays and poor user experience.
set updatetime=50
" Don't pass messages to |ins-completion-menu|.
set shortmess+=c
" Always show the signcolumn, otherwise it would shift the text each time
" diagnostics appear/become resolved.
set signcolumn=yes
" disable signcolumn for tagbar, nerdtree, as thats useless
autocmd FileType tagbar,nerdtree setlocal signcolumn=no
" Use tab for trigger completion with characters ahead and navigate.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current
" position. Coc only does snippet and additional edit on confirm.
" <cr> could be remapped by other vim plugin, try `:verbose imap <CR>`.
if exists('*complete_info')
inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
else
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
endif
""""""""""""""""""""""""""""""""
" Elixir - thanks to: https://bernheisel.com/blog/vim-elixir-ls-plug/
""""""""""""""""""""""""""""""""
" Define elixir_ls dictionary
let g:ElixirLS = {}
let ElixirLS.path = stdpath('config').'/plugged/elixir-ls'
let ElixirLS.lsp = ElixirLS.path.'/release/language_server.sh'
let ElixirLS.cmd = join([
\ 'asdf install &&',
\ 'mix do',
\ 'local.hex --force --if-missing,',
\ 'local.rebar --force,',
\ 'deps.get,',
\ 'compile,',
\ 'elixir_ls.release'
\ ], ' ')
" run it in background
function ElixirLS.on_stdout(_job_id, data, _event)
let self.output[-1] .= a:data[0]
call extend(self.output, a:data[1:])
endfunction
let ElixirLS.on_stderr = function(ElixirLS.on_stdout)
function ElixirLS.on_exit(_job_id, exitcode, _event)
if a:exitcode[0] == 0
echom '>>> ElixirLS compiled'
else
echoerr join(self.output, ' ')
echoerr '>>> ElixirLS compilation failed'
endif
endfunction
function ElixirLS.compile()
let me = copy(g:ElixirLS)
let me.output = ['']
echom '>>> compiling ElixirLS'
let me.id = jobstart('cd ' . me.path . ' && git pull && ' . me.cmd, me)
endfunction
" update the Elixir language server
call coc#config('elixir', {
\ 'command': g:ElixirLS.lsp,
\ 'filetypes': ['elixir', 'eelixir']
\})
call coc#config('elixir.pathToElixirLS', g:ElixirLS.lsp)
""""""""""""""""""""""""""""""""
" NerdTree
""""""""""""""""""""""""""""""""
nnoremap <silent> <leader>tt :NERDTreeToggle<CR>
" close vim if the only window left open is a NERDTree
autocmd BufEnter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" If you are using vim-plug, you'll also need to add these lines to avoid crashes when calling vim-plug functions while the cursor is on the NERDTree window:
let g:plug_window = 'noautocmd vertical topleft new'
" show dot/hidden files
let NERDTreeShowHidden=1
"""""""""""""""""""""""""""""""
" tags
"""""""""""""""""""""""""""""""
let g:tagbar_type_elixir = {
\ 'ctagstype' : 'elixir',
\ 'kinds' : [
\ 'p:protocols',
\ 'm:modules',
\ 'e:exceptions',
\ 'y:types',
\ 'd:delegates',
\ 'f:functions',
\ 'c:callbacks',
\ 'a:macros',
\ 't:tests',
\ 'i:implementations',
\ 'o:operators',
\ 'r:records'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 'p' : 'protocol',
\ 'm' : 'module'
\ },
\ 'scope2kind' : {
\ 'protocol' : 'p',
\ 'module' : 'm'
\ },
\ 'sort' : 0
\ }
nnoremap <silent> <leader>tc :TagbarToggle<CR>
"""""""""""""""""""""""""""
" splits
"""""""""""""""""""""""""""
map - <C-W>-
map + <C-W>+
nnoremap <leader>h :wincmd h<CR>
nnoremap <leader>j :wincmd j<CR>
nnoremap <leader>k :wincmd k<CR>
nnoremap <leader>l :wincmd l<CR>
""""""""""""""""""""""""""
" Rust
""""""""""""""""""""""""""
" run rustfmt on save
let g:rustfmt_autosave = 1
"""""""""""""""""""""""""
" fzf
"""""""""""""""""""""""""
map \ :Files<CR>
""""""""""""""""""""""""
" Mundo - undo tree
""""""""""""""""""""""""
" Enable persistent undo so that undo history persists across vim sessions
set undofile
set undodir=~/.vim/undo
nnoremap <leader>tu :MundoToggle<CR>
""""""""""""""""""""""
" patch-1
""""""""""""""""""""""
let g:vim_json_syntax_conceal = 0
" save
map <C-w> :w<cr>
imap <C-w> <C-o>:w<cr>
# $HOME/.config/kitty/kitty.conf
font_size 10.0
font_family FuraCode Nerd Mono Medium
bold_font FureCode Nerd Mono Bold
enabled_layouts tall
map ctrl+shift+p new_window
active_border_color none
inactive_border_color #444444
background_opacity .96
include ./kitty-themes/themes/gruvbox_dark.conf
# $HOME/.zsh/nvm.zsh
\. "$NVM_DIR/nvm.sh" --no-use
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
local nvm_default="$(nvm version default)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
unset NPM_CONFIG_PREFIX
if [ $nvmrc_node_version = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then
nvm use
fi
elif [ $node_version != $nvm_default ]; then
nvm use default
if [ $nvm_default = "system" ]; then
export NPM_CONFIG_PREFIX=~/.npm-global
else
unset NPM_CONFIG_PREFIX
fi
else
export NPM_CONFIG_PREFIX=~/.npm-global
fi
}
autoload -U add-zsh-hook
add-zsh-hook chpwd load-nvmrc
load-nvmrc
# $HOME/.config/starship.toml
# Don't print a new line at the start of the prompt
add_newline = false
[username]
show_always = true
[character]
symbol = "(∩`-´)⊃━☆゚.*・。゚ ❯"
error_symbol = "(ง •̀_•́)ง ❯"
style_success = "bold blue"
use_symbol_for_status = true
[git_status]
conflicted = " ~ "
ahead = " ⇡ "
behind = " ⇣ "
staged=" + "
diverged = " ⇕ "
untracked = " ? "
stashed = " $ "
modified = " ! "
deleted = "  "
renamed = " ➜ "
unmerged = " ═ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment