parent
a914f372c3
commit
a4ea2db3cd
@ -0,0 +1,376 @@
|
||||
" Fisa-nvim-config
|
||||
" http://nvim.fisadev.com
|
||||
" version: 11.1
|
||||
|
||||
" TODO current problems:
|
||||
" * end key not working undef tmux+fish
|
||||
|
||||
" ============================================================================
|
||||
" Vim-plug initialization
|
||||
" Avoid modifying this section, unless you are very sure of what you are doing
|
||||
|
||||
let vim_plug_just_installed = 0
|
||||
let vim_plug_path = expand('~/.config/nvim/autoload/plug.vim')
|
||||
if !filereadable(vim_plug_path)
|
||||
echo "Installing Vim-plug..."
|
||||
echo ""
|
||||
silent !mkdir -p ~/.config/nvim/autoload
|
||||
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
let vim_plug_just_installed = 1
|
||||
endif
|
||||
|
||||
" manually load vim-plug the first time
|
||||
if vim_plug_just_installed
|
||||
:execute 'source '.fnameescape(vim_plug_path)
|
||||
endif
|
||||
|
||||
" Obscure hacks done, you can now modify the rest of the .vimrc as you wish :)
|
||||
|
||||
" ============================================================================
|
||||
" Active plugins
|
||||
" You can disable or add new ones here:
|
||||
|
||||
" this needs to be here, so vim-plug knows we are declaring the plugins we
|
||||
" want to use
|
||||
call plug#begin('~/.config/nvim/plugged')
|
||||
|
||||
" Now the actual plugins:
|
||||
|
||||
" Override configs by directory
|
||||
Plug 'arielrossanigo/dir-configs-override.vim'
|
||||
|
||||
" Code commenter
|
||||
Plug 'scrooloose/nerdcommenter'
|
||||
|
||||
" Better file browser
|
||||
Plug 'scrooloose/nerdtree'
|
||||
|
||||
" Class/module browser
|
||||
Plug 'majutsushi/tagbar'
|
||||
" TODO known problems:
|
||||
" * current block not refreshing
|
||||
|
||||
" Search results counter
|
||||
Plug 'vim-scripts/IndexedSearch'
|
||||
|
||||
" Terminal Vim with 256 colors colorscheme
|
||||
Plug 'fisadev/fisa-vim-colorscheme'
|
||||
|
||||
" Airline
|
||||
Plug 'vim-airline/vim-airline'
|
||||
Plug 'vim-airline/vim-airline-themes'
|
||||
|
||||
" Code and files fuzzy finder
|
||||
" Plug 'ctrlpvim/ctrlp.vim'
|
||||
" Extension to ctrlp, for fuzzy command finder
|
||||
" Plug 'fisadev/vim-ctrlp-cmdpalette'
|
||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
|
||||
" Pending tasks list
|
||||
Plug 'fisadev/FixedTaskList.vim'
|
||||
|
||||
" Async autocompletion
|
||||
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
||||
" Completion from other opened files
|
||||
Plug 'Shougo/context_filetype.vim'
|
||||
" Python autocompletion
|
||||
Plug 'zchee/deoplete-jedi', { 'do': ':UpdateRemotePlugins' }
|
||||
" Just to add the python go-to-definition and similar features, autocompletion
|
||||
" from this plugin is disabled
|
||||
Plug 'davidhalter/jedi-vim'
|
||||
|
||||
" Automatically close parenthesis, etc
|
||||
Plug 'Townk/vim-autoclose'
|
||||
|
||||
" Surround
|
||||
Plug 'tpope/vim-surround'
|
||||
|
||||
" Indent text object
|
||||
Plug 'michaeljsmith/vim-indent-object'
|
||||
|
||||
" Indentation based movements
|
||||
Plug 'jeetsukumaran/vim-indentwise'
|
||||
|
||||
" Better language packs
|
||||
Plug 'sheerun/vim-polyglot'
|
||||
|
||||
" Ack code search (requires ack installed in the system)
|
||||
Plug 'mileszs/ack.vim'
|
||||
" TODO is there a way to prevent the progress which hides the editor?
|
||||
|
||||
" Paint css colors with the real color
|
||||
Plug 'lilydjwg/colorizer'
|
||||
" TODO is there a better option for neovim?
|
||||
|
||||
" Window chooser
|
||||
Plug 't9md/vim-choosewin'
|
||||
|
||||
" Automatically sort python imports
|
||||
Plug 'fisadev/vim-isort'
|
||||
|
||||
" Highlight matching html tags
|
||||
Plug 'valloric/MatchTagAlways'
|
||||
|
||||
" Generate html in a simple way
|
||||
Plug 'mattn/emmet-vim'
|
||||
|
||||
" Git integration
|
||||
Plug 'tpope/vim-fugitive'
|
||||
|
||||
" Git/mercurial/others diff icons on the side of the file lines
|
||||
Plug 'mhinz/vim-signify'
|
||||
|
||||
" Yank history navigation
|
||||
Plug 'vim-scripts/YankRing.vim'
|
||||
|
||||
" Linters
|
||||
Plug 'neomake/neomake'
|
||||
" TODO is it running on save? or when?
|
||||
" TODO not detecting errors, just style, is it using pylint?
|
||||
|
||||
" Relative numbering of lines (0 is the current line)
|
||||
" (disabled by default because is very intrusive and can't be easily toggled
|
||||
" on/off. When the plugin is present, will always activate the relative
|
||||
" numbering every time you go to normal mode. Author refuses to add a setting
|
||||
" to avoid that)
|
||||
Plug 'myusuf3/numbers.vim'
|
||||
|
||||
" Nice icons
|
||||
" Plug 'ryanoasis/vim-devicons'
|
||||
|
||||
" Tell vim-plug we finished declaring plugins, so it can load them
|
||||
call plug#end()
|
||||
|
||||
" ============================================================================
|
||||
" Install plugins the first time vim runs
|
||||
|
||||
if vim_plug_just_installed
|
||||
echo "Installing Bundles, please ignore key map error messages"
|
||||
:PlugInstall
|
||||
endif
|
||||
|
||||
" ============================================================================
|
||||
" Vim settings and mappings
|
||||
" You can edit them as you wish
|
||||
|
||||
" tabs and spaces handling
|
||||
set expandtab
|
||||
set tabstop=4
|
||||
set softtabstop=4
|
||||
set shiftwidth=4
|
||||
|
||||
" show line numbers
|
||||
set nu
|
||||
|
||||
" remove ugly vertical lines on window division
|
||||
set fillchars+=vert:\
|
||||
|
||||
" use 256 colors when possible
|
||||
if (&term =~? 'mlterm\|xterm\|xterm-256\|screen-256') || has('nvim')
|
||||
let &t_Co = 256
|
||||
colorscheme fisa
|
||||
else
|
||||
colorscheme delek
|
||||
endif
|
||||
|
||||
" needed so deoplete can auto select the first suggestion
|
||||
set completeopt+=noinsert
|
||||
" comment this line to enable autocompletion preview window
|
||||
" (displays documentation related to the selected completion option)
|
||||
set completeopt-=preview
|
||||
|
||||
" autocompletion of files and commands behaves like shell
|
||||
" (complete only the common part, list the options that match)
|
||||
set wildmode=list:longest
|
||||
|
||||
" save as sudo
|
||||
ca w!! w !sudo tee "%"
|
||||
|
||||
" tab navigation mappings
|
||||
map tt :tabnew
|
||||
map <M-Right> :tabn<CR>
|
||||
imap <M-Right> <ESC>:tabn<CR>
|
||||
map <M-Left> :tabp<CR>
|
||||
imap <M-Left> <ESC>:tabp<CR>
|
||||
|
||||
" when scrolling, keep cursor 3 lines away from screen border
|
||||
set scrolloff=3
|
||||
|
||||
" clear search results
|
||||
nnoremap <silent> // :noh<CR>
|
||||
|
||||
" clear empty spaces at the end of lines on save of python files
|
||||
autocmd BufWritePre *.py :%s/\s\+$//e
|
||||
|
||||
" fix problems with uncommon shells (fish, xonsh) and plugins running commands
|
||||
" (neomake, ...)
|
||||
set shell=/bin/bash
|
||||
|
||||
" Ability to add python breakpoints
|
||||
" (I use ipdb, but you can change it to whatever tool you use for debugging)
|
||||
au FileType python map <silent> <leader>b Oimport ipdb; ipdb.set_trace()<esc>
|
||||
|
||||
" ============================================================================
|
||||
" Plugins settings and mappings
|
||||
" Edit them as you wish.
|
||||
|
||||
" Tagbar -----------------------------
|
||||
|
||||
" toggle tagbar display
|
||||
map <F4> :TagbarToggle<CR>
|
||||
" autofocus on tagbar open
|
||||
let g:tagbar_autofocus = 1
|
||||
|
||||
" NERDTree -----------------------------
|
||||
|
||||
" toggle nerdtree display
|
||||
map <F3> :NERDTreeToggle<CR>
|
||||
" open nerdtree with the current file selected
|
||||
nmap ,t :NERDTreeFind<CR>
|
||||
" don;t show these file types
|
||||
let NERDTreeIgnore = ['\.pyc$', '\.pyo$']
|
||||
|
||||
" Tasklist ------------------------------
|
||||
|
||||
" show pending tasks list
|
||||
map <F2> :TaskList<CR>
|
||||
|
||||
" Neomake ------------------------------
|
||||
|
||||
" Run linter on write
|
||||
autocmd! BufWritePost * Neomake
|
||||
|
||||
" Check code as python3 by default
|
||||
let g:neomake_python_python_maker = neomake#makers#ft#python#python()
|
||||
let g:neomake_python_flake8_maker = neomake#makers#ft#python#flake8()
|
||||
let g:neomake_python_python_maker.exe = 'python3 -m py_compile'
|
||||
let g:neomake_python_flake8_maker.exe = 'python3 -m flake8'
|
||||
|
||||
" Disable error messages inside the buffer, next to the problematic line
|
||||
let g:neomake_virtualtext_current_error = 0
|
||||
|
||||
" Fzf ------------------------------
|
||||
|
||||
" file finder mapping
|
||||
nmap ,e :Files<CR>
|
||||
" tags (symbols) in current file finder mapping
|
||||
nmap ,g :BTag<CR>
|
||||
" tags (symbols) in all files finder mapping
|
||||
nmap ,G :Tags<CR>
|
||||
" general code finder in current file mapping
|
||||
nmap ,f :BLines<CR>
|
||||
" general code finder in all files mapping
|
||||
nmap ,F :Lines<CR>
|
||||
" commands finder mapping
|
||||
nmap ,c :Commands<CR>
|
||||
" to be able to call CtrlP with default search text
|
||||
"function! CtrlPWithSearchText(search_text, ctrlp_command_end)
|
||||
"execute ':CtrlP' . a:ctrlp_command_end
|
||||
"call feedkeys(a:search_text)
|
||||
"endfunction
|
||||
" same as previous mappings, but calling with current word as default text
|
||||
"nmap ,wg :call CtrlPWithSearchText(expand('<cword>'), 'BufTag')<CR>
|
||||
"nmap ,wG :call CtrlPWithSearchText(expand('<cword>'), 'BufTagAll')<CR>
|
||||
"nmap ,wf :call CtrlPWithSearchText(expand('<cword>'), 'Line')<CR>
|
||||
"nmap ,we :call CtrlPWithSearchText(expand('<cword>'), '')<CR>
|
||||
"nmap ,pe :call CtrlPWithSearchText(expand('<cfile>'), '')<CR>
|
||||
"nmap ,wm :call CtrlPWithSearchText(expand('<cword>'), 'MRUFiles')<CR>
|
||||
"nmap ,wc :call CtrlPWithSearchText(expand('<cword>'), 'CmdPalette')<CR>
|
||||
|
||||
|
||||
" Deoplete -----------------------------
|
||||
|
||||
" Use deoplete.
|
||||
|
||||
let g:deoplete#enable_at_startup = 1
|
||||
let g:deoplete#enable_ignore_case = 1
|
||||
let g:deoplete#enable_smart_case = 1
|
||||
" complete with words from any opened file
|
||||
let g:context_filetype#same_filetypes = {}
|
||||
let g:context_filetype#same_filetypes._ = '_'
|
||||
|
||||
" Jedi-vim ------------------------------
|
||||
|
||||
" Disable autocompletion (using deoplete instead)
|
||||
let g:jedi#completions_enabled = 0
|
||||
|
||||
" All these mappings work only for python code:
|
||||
" Go to definition
|
||||
let g:jedi#goto_command = ',d'
|
||||
" Find ocurrences
|
||||
let g:jedi#usages_command = ',o'
|
||||
" Find assignments
|
||||
let g:jedi#goto_assignments_command = ',a'
|
||||
" Go to definition in new tab
|
||||
nmap ,D :tab split<CR>:call jedi#goto()<CR>
|
||||
|
||||
" Ack.vim ------------------------------
|
||||
|
||||
" mappings
|
||||
nmap ,r :Ack
|
||||
nmap ,wr :Ack <cword><CR>
|
||||
|
||||
" Window Chooser ------------------------------
|
||||
|
||||
" mapping
|
||||
nmap - <Plug>(choosewin)
|
||||
" show big letters
|
||||
let g:choosewin_overlay_enable = 1
|
||||
|
||||
" Signify ------------------------------
|
||||
|
||||
" this first setting decides in which order try to guess your current vcs
|
||||
" UPDATE it to reflect your preferences, it will speed up opening files
|
||||
let g:signify_vcs_list = [ 'git', 'hg' ]
|
||||
" mappings to jump to changed blocks
|
||||
nmap <leader>sn <plug>(signify-next-hunk)
|
||||
nmap <leader>sp <plug>(signify-prev-hunk)
|
||||
" nicer colors
|
||||
highlight DiffAdd cterm=bold ctermbg=none ctermfg=119
|
||||
highlight DiffDelete cterm=bold ctermbg=none ctermfg=167
|
||||
highlight DiffChange cterm=bold ctermbg=none ctermfg=227
|
||||
highlight SignifySignAdd cterm=bold ctermbg=237 ctermfg=119
|
||||
highlight SignifySignDelete cterm=bold ctermbg=237 ctermfg=167
|
||||
highlight SignifySignChange cterm=bold ctermbg=237 ctermfg=227
|
||||
|
||||
" Autoclose ------------------------------
|
||||
|
||||
" Fix to let ESC work as espected with Autoclose plugin
|
||||
" (without this, when showing an autocompletion window, ESC won't leave insert
|
||||
" mode)
|
||||
let g:AutoClosePumvisible = {"ENTER": "\<C-Y>", "ESC": "\<ESC>"}
|
||||
|
||||
" Yankring -------------------------------
|
||||
|
||||
" Fix for yankring and neovim problem when system has non-text things copied
|
||||
" in clipboard
|
||||
let g:yankring_clipboard_monitor = 0
|
||||
let g:yankring_history_dir = '~/.config/nvim/'
|
||||
|
||||
" Airline ------------------------------
|
||||
|
||||
let g:airline_powerline_fonts = 0
|
||||
let g:airline_theme = 'bubblegum'
|
||||
let g:airline#extensions#whitespace#enabled = 0
|
||||
|
||||
" to use fancy symbols for airline, uncomment the following lines and use a
|
||||
" patched font (more info on docs/fancy_symbols.rst)
|
||||
"if !exists('g:airline_symbols')
|
||||
"let g:airline_symbols = {}
|
||||
"endif
|
||||
"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 = '⭡'
|
||||
|
||||
|
||||
" Custom configurations ----------------
|
||||
|
||||
" Include user's custom nvim configurations
|
||||
if filereadable(expand("~/.config/nvim/custom.vim"))
|
||||
source ~/.config/nvim/custom.vim
|
||||
endif
|
||||
@ -0,0 +1,49 @@
|
||||
[global_config]
|
||||
inactive_color_offset = 0.75
|
||||
always_split_with_profile = True
|
||||
title_font = DroidSansMono Nerd Font 9
|
||||
[keybindings]
|
||||
[profiles]
|
||||
[[default]]
|
||||
allow_bold = False
|
||||
audible_bell = True
|
||||
background_color = "#2e3436"
|
||||
background_darkness = 0.8
|
||||
background_type = transparent
|
||||
cursor_color = "#fb0007"
|
||||
font = Hack Nerd Font Mono Bold 11
|
||||
foreground_color = "#f9f9f9"
|
||||
show_titlebar = False
|
||||
scrollback_infinite = True
|
||||
palette = "#121212:#fa2934:#98e123:#fff30a:#0443ff:#f800f8:#01b6ed:#ffffff:#838383:#f6669d:#b1e05f:#fff26d:#0443ff:#f200f6:#51ceff:#ffffff"
|
||||
use_system_font = False
|
||||
[[Flat]]
|
||||
audible_bell = True
|
||||
background_color = "#2e3436"
|
||||
background_darkness = 0.95
|
||||
background_type = transparent
|
||||
cursor_color = "#fb0007"
|
||||
font = DroidSansMono Nerd Font Mono 12
|
||||
foreground_color = "#f9f9f9"
|
||||
palette = "#1F2229:#D41919:#5EBDAB:#FEA44C:#367bf0:#BF2E5D:#49AEE6:#FFFFFF:#8C42AB:#EC0101:#47D4B9:#FF8A18:#277FFF:#D71655:#05A1F7:#FFFFFF"
|
||||
use_system_font = False
|
||||
[layouts]
|
||||
[[default]]
|
||||
[[[child0]]]
|
||||
type = Window
|
||||
parent = ""
|
||||
order = 0
|
||||
position = 3888:0
|
||||
maximised = True
|
||||
fullscreen = False
|
||||
size = 1872, 1043
|
||||
title = dustyp@dustyp-XPS-15-9575: ~
|
||||
last_active_term = 7a3139cc-cd5d-48a4-b1d3-1fc2a7455abb
|
||||
last_active_window = True
|
||||
[[[terminal1]]]
|
||||
type = Terminal
|
||||
parent = child0
|
||||
order = 0
|
||||
profile = Flat
|
||||
uuid = 7a3139cc-cd5d-48a4-b1d3-1fc2a7455abb
|
||||
[plugins]
|
||||
@ -0,0 +1,48 @@
|
||||
#!/usr/bin/zsh
|
||||
|
||||
###############################################################################
|
||||
# This Script will install everything required for oh-my-zsh, Powerlevel10k, #
|
||||
# Nerd Fonts, and the dotfiles in this repo. It will take a long time to run #
|
||||
# as the Nerd Fonts will need to download and they are over 2GB in size. #
|
||||
###############################################################################
|
||||
|
||||
# Install Terminator
|
||||
sudo apt install terminator -y
|
||||
|
||||
# Install NeoVim and dependants
|
||||
sudo apt install neovim pyenv exuberant-ctags git ack-grep -y
|
||||
pyenv install 3.8.0
|
||||
pyenv local 3.8.0
|
||||
pip install neovim pep8 flake8 pyflakes pylint isort black
|
||||
|
||||
# Download and install oh-my-zsh
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
# Download PowerLevel10K and put it in the custom theme directory for oh-my-zsh
|
||||
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
|
||||
|
||||
# Download Nerd Fonts
|
||||
wget https://github.com/ryanoasis/nerd-fonts/archive/master.zip
|
||||
# Extract and install Nerd Fonts
|
||||
unzip ./master.zip
|
||||
cd master
|
||||
./install.sh
|
||||
|
||||
# Download plugins for oh-my-zsh
|
||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
||||
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
||||
|
||||
# Symlink dotfiles. This allows updates to dotfiles to be automatically applied
|
||||
# just by pulling an update from this repo
|
||||
[[ ! -d "~/.config/terminator" ]] && mkdir -p ~/.config/terminator
|
||||
[[ -a "~/.config/terminator/config" ]] && mv ~/.config/terminator/config ~/.config/terminator/config.old
|
||||
ln -s ./terminator/config ~/.config/terminator/config
|
||||
|
||||
[[ -a "~/.zshrc" ]] && mv ~/.zshrc ~/.zshrc.old
|
||||
ln -s ./zsh/.zshrc ~/.zshrc
|
||||
|
||||
[[ -a "~/.p10k.zsh" ]] && mv ~/.p10k.zsh ~/.p10k.zsh.old
|
||||
ln -s ./zsh/.p10k.zsh ~/.p10k.zsh
|
||||
|
||||
[[ ! -d "~/.config/nvim" ]] && mkdir -p ~/.config/nvim
|
||||
[[ -a "~/.config/nvim/init.vim" ]] && mv ~/.config/nvim/init.vim ~/.config/nvim/init.vim.old
|
||||
ln -s ./neovim/init.vim ~/.config/nvim/init.vim
|
||||
@ -0,0 +1,228 @@
|
||||
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
||||
# Initialization code that may require console input (password prompts, [y/n]
|
||||
# confirmations, etc.) must go above this block, everything else may go below.
|
||||
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||
fi
|
||||
|
||||
# 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/dustyp/.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="powerlevel10k/powerlevel10k"
|
||||
POWERLEVEL9K_MODE='nerdfont-complete'
|
||||
|
||||
# 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 ~/.oh-my-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 the following line to disable bi-weekly auto-update checks.
|
||||
# DISABLE_AUTO_UPDATE="true"
|
||||
|
||||
# Uncomment the following line to automatically update without prompting.
|
||||
# DISABLE_UPDATE_PROMPT="true"
|
||||
|
||||
# Uncomment the following line to change how often to auto-update (in days).
|
||||
# export UPDATE_ZSH_DAYS=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.
|
||||
# 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 ~/.oh-my-zsh/plugins/*
|
||||
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
|
||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||
# Add wisely, as too many plugins slow down shell startup.
|
||||
plugins=(
|
||||
git
|
||||
zsh-syntax-highlighting
|
||||
zsh-autosuggestions
|
||||
extract
|
||||
sudo
|
||||
history
|
||||
catimg
|
||||
pip
|
||||
python
|
||||
pyenv
|
||||
)
|
||||
|
||||
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='mvim'
|
||||
# fi
|
||||
|
||||
# Compilation flags
|
||||
# export ARCHFLAGS="-arch x86_64"
|
||||
|
||||
# Set personal aliases, overriding those provided by oh-my-zsh libs,
|
||||
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
|
||||
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
|
||||
# For a full list of active aliases, run `alias`.
|
||||
#
|
||||
# Example aliases
|
||||
# alias zshconfig="mate ~/.zshrc"
|
||||
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
||||
|
||||
alias ls='lsd --group-dirs first'
|
||||
alias ll='lsd --group-dirs first -la'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias vi='vim'
|
||||
alias xclip='xclip -selection c'
|
||||
|
||||
export VISUAL=vim
|
||||
export EDITOR=$VISUAL
|
||||
|
||||
export LESS_TERMCAP_mb=$'\e[1;32m'
|
||||
export LESS_TERMCAP_md=$'\e[1;32m'
|
||||
export LESS_TERMCAP_me=$'\e[0m'
|
||||
export LESS_TERMCAP_se=$'\e[0m'
|
||||
export LESS_TERMCAP_so=$'\e[01;33m'
|
||||
export LESS_TERMCAP_ue=$'\e[0m'
|
||||
export LESS_TERMCAP_us=$'\e[1;4;31m'
|
||||
|
||||
bindkey '^`' autosuggest-clear
|
||||
bindkey -v
|
||||
|
||||
# ------ ZSH Settings -----
|
||||
|
||||
unsetopt NO_BEEP
|
||||
unsetopt NO_MATCH
|
||||
setopt AUTO_CD
|
||||
setopt BEEP
|
||||
setopt NOMATCH
|
||||
setopt NOTIFY
|
||||
setopt INC_APPEND_HISTORY
|
||||
setopt SHARE_HISTORY
|
||||
setopt HIST_EXPIRE_DUPS_FIRST
|
||||
setopt HIST_IGNORE_DUPS
|
||||
setopt HIST_IGNORE_ALL_DUPS
|
||||
setopt HIST_FIND_NO_DUPS
|
||||
setopt HIST_SAVE_NO_DUPS
|
||||
setopt HIST_REDUCE_BLANKS
|
||||
setopt HIST_VERIFY
|
||||
setopt HIST_BEEP
|
||||
setopt INTERACTIVE_COMMENTS
|
||||
setopt MAGIC_EQUAL_SUBST
|
||||
|
||||
HISTFILE="$HOME/.zsh_history"
|
||||
HIST_STAMPS=yyyy-mm-dd
|
||||
DISABLE_UPDATE_PROMPT=true
|
||||
HISTSIZE=5000
|
||||
SAVEHIST=5000
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=#ccc'
|
||||
ZLE_RPROMPT_INDENT=0
|
||||
|
||||
# ----- POWERLEVEL -----
|
||||
|
||||
prompt_zsh_battery_level() {
|
||||
local percentage1=`acpi | grep -m 1 -o '[0-9]*%'`
|
||||
local percentage=`echo "${percentage1//\%}"`
|
||||
|
||||
local color='%F{red}'
|
||||
local symbol="\uf00d"
|
||||
acpi | grep "Discharging" > /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
local charging="false";
|
||||
else
|
||||
local charging="true";
|
||||
fi
|
||||
if [ $percentage -le 20 ]
|
||||
then symbol='\uf579' ; color='%F{red}' ;
|
||||
#10%
|
||||
elif [ $percentage -gt 19 ] && [ $percentage -le 30 ]
|
||||
then symbol="\uf57a" ; color='%F{red}' ;
|
||||
#20%
|
||||
elif [ $percentage -gt 29 ] && [ $percentage -le 40 ]
|
||||
then symbol="\uf57b" ; color='%F{yellow}' ;
|
||||
#35%
|
||||
elif [ $percentage -gt 39 ] && [ $percentage -le 50 ]
|
||||
then symbol="\uf57c" ; color='%F{yellow}' ;
|
||||
#45%
|
||||
elif [ $percentage -gt 49 ] && [ $percentage -le 60 ]
|
||||
then symbol="\uf57d" ; color='%F{blue}' ;
|
||||
#55%
|
||||
elif [ $percentage -gt 59 ] && [ $percentage -le 70 ]
|
||||
then symbol="\uf57e" ; color='%F{blue}' ;
|
||||
#65%
|
||||
elif [ $percentage -gt 69 ] && [ $percentage -le 80 ]
|
||||
then symbol="\uf57f" ; color='%F{blue}' ;
|
||||
#75%
|
||||
elif [ $percentage -gt 79 ] && [ $percentage -le 90 ]
|
||||
then symbol="\uf580" ; color='%F{blue}' ;
|
||||
#85%
|
||||
elif [ $percentage -gt 89 ] && [ $percentage -le 99 ]
|
||||
then symbol="\uf581" ; color='%F{blue}' ;
|
||||
#85%
|
||||
elif [ $percentage -gt 98 ]
|
||||
then symbol="\uf578" ; color='%F{green}' ;
|
||||
#100%
|
||||
fi
|
||||
if [ $charging = "true" ];
|
||||
then color='%F{green}'; if [ $percentage -gt 98 ]; then symbol='\uf584'; fi
|
||||
fi
|
||||
echo -n "%F{white}\uE0B3 %{$color%}$symbol %F{white}$percentage%% " ;
|
||||
}
|
||||
|
||||
|
||||
# POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_os_icon ssh virtualenv pyenv root_indicator dir dir_writable vcs)
|
||||
# POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(command_execution_time status background_jobs time zsh_battery_level ram)
|
||||
|
||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
||||
|
||||
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
|
||||
Loading…
Reference in new issue