nvim todo tuneado (aunque falta golang) y un par de giladas de zsh
This commit is contained in:
parent
f20c2905cc
commit
5231721aa8
10
fzf-marks
10
fzf-marks
|
@ -6,16 +6,16 @@ lfview : /home/corpse/.local/bin/lfview
|
||||||
gtk2 : /home/corpse/.config/gtk-2.0/gtkrc-2.0
|
gtk2 : /home/corpse/.config/gtk-2.0/gtkrc-2.0
|
||||||
dunst : /home/corpse/.config/dunst/dunstrc
|
dunst : /home/corpse/.config/dunst/dunstrc
|
||||||
xresources : /home/corpse/.config/X11/xresources
|
xresources : /home/corpse/.config/X11/xresources
|
||||||
polybar : /home/corpse/.config/polybar/config
|
|
||||||
correo : /home/corpse/.config/neomutt
|
correo : /home/corpse/.config/neomutt
|
||||||
xinit : /home/corpse/.config/X11/xinitrc
|
xinit : /home/corpse/.config/X11/xinitrc
|
||||||
bspwm : /home/corpse/.config/bspwm/bspwmrc
|
|
||||||
terminal : /home/corpse/.config/alacritty.yml
|
terminal : /home/corpse/.config/alacritty.yml
|
||||||
tmux : /home/corpse/.config/tmux/tmux.conf
|
tmux : /home/corpse/.config/tmux/tmux.conf
|
||||||
keys : /home/corpse/.config/sxhkd/sxhkdrc
|
|
||||||
lf : /home/corpse/.config/lf/lfrc
|
|
||||||
alias : /home/corpse/.config/zsh/conf/03_aliases.zsh
|
alias : /home/corpse/.config/zsh/conf/03_aliases.zsh
|
||||||
|
mpv : /home/corpse/.config/mpv/mpv.conf
|
||||||
|
lf : /home/corpse/.config/lf/lfrc
|
||||||
zshenv : /home/corpse/.zshenv
|
zshenv : /home/corpse/.zshenv
|
||||||
|
polybar : /home/corpse/.config/polybar/config
|
||||||
|
keys : /home/corpse/.config/sxhkd/sxhkdrc
|
||||||
|
bspwm : /home/corpse/.config/bspwm/bspwmrc
|
||||||
nvim : /home/corpse/.config/nvim
|
nvim : /home/corpse/.config/nvim
|
||||||
zsh : /home/corpse/.config/zsh
|
zsh : /home/corpse/.config/zsh
|
||||||
mpv : /home/corpse/.config/mpv/mpv.conf
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
[Settings]
|
[Settings]
|
||||||
gtk-application-prefer-dark-theme=1
|
gtk-application-prefer-dark-theme=1
|
||||||
|
gtk-cursor-theme-name=Grounation
|
||||||
gtk-theme-name=Skeuos-Black-Dark
|
gtk-theme-name=Skeuos-Black-Dark
|
||||||
gtk-icon-theme-name=BluecurveRH
|
gtk-icon-theme-name=BluecurveRH
|
||||||
gtk-font-name=System Charcoal 10
|
gtk-font-name=System Charcoal 10
|
||||||
|
@ -16,4 +17,3 @@ gtk-xft-hintstyle=hintslight
|
||||||
gtk-xft-rgba=rgb
|
gtk-xft-rgba=rgb
|
||||||
gtk-modules=gail:atk-bridge
|
gtk-modules=gail:atk-bridge
|
||||||
gtk-decoration-layout=menu:
|
gtk-decoration-layout=menu:
|
||||||
gtk-cursor-theme-name=Grounation
|
|
||||||
|
|
68
lf/lfrc
68
lf/lfrc
|
@ -16,6 +16,7 @@ set preview
|
||||||
set previewer lfview
|
set previewer lfview
|
||||||
set ratios 2:4
|
set ratios 2:4
|
||||||
set icons
|
set icons
|
||||||
|
recol
|
||||||
|
|
||||||
%[ $LF_LEVEL -eq 1 ] || echo "Warning: You're in a nested lf instance!"
|
%[ $LF_LEVEL -eq 1 ] || echo "Warning: You're in a nested lf instance!"
|
||||||
|
|
||||||
|
@ -33,6 +34,17 @@ cmd open ${{
|
||||||
esac
|
esac
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
cmd recol &{{
|
||||||
|
w=$(tput cols)
|
||||||
|
if [ $w -le 80 ]; then
|
||||||
|
lf -remote "send $id set ratios 1:1"
|
||||||
|
elif [ $w -le 160 ]; then
|
||||||
|
lf -remote "send $id set ratios 2:2"
|
||||||
|
else
|
||||||
|
lf -remote "send $id set ratios 2:4"
|
||||||
|
fi
|
||||||
|
}}
|
||||||
|
|
||||||
cmd bulkrename ${{
|
cmd bulkrename ${{
|
||||||
old=$(mktemp)
|
old=$(mktemp)
|
||||||
new=$(mktemp)
|
new=$(mktemp)
|
||||||
|
@ -98,42 +110,32 @@ cmd rename-new &{{
|
||||||
}}
|
}}
|
||||||
|
|
||||||
cmd paste-rsync &{{
|
cmd paste-rsync &{{
|
||||||
load=$(lf -remote 'load')
|
set -- $(cat ~/.local/share/lf/files)
|
||||||
mode=$(echo "$load" | sed -n '1p')
|
mode="$1"
|
||||||
list=$(echo "$load" | sed '1d')
|
shift
|
||||||
|
case "$mode" in
|
||||||
if [ $mode = 'copy']; then
|
copy)
|
||||||
rsync -av --ignore-existing --progress $list . \
|
rsync -av --ignore-existing --progress -- "$@" . |
|
||||||
| stdbuf -i0 -o0 -e0 tr '\r' '\n' \
|
stdbuf -i0 -o0 -e0 tr '\r' '\n' |
|
||||||
| while read line; do
|
while IFS= read -r line; do
|
||||||
lf -remote "send $id echo $line"
|
lf -remote "send $id echo $line"
|
||||||
done
|
done
|
||||||
elif [ $mode = 'move' ]; then
|
;;
|
||||||
mv -n $list .
|
move) mv -n -- "$@" .;;
|
||||||
fi
|
esac
|
||||||
|
rm ~/.local/share/lf/files
|
||||||
lf -remote 'send load'
|
lf -remote "send clear"
|
||||||
lf -remote 'send clear'
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
cmd paste-overwrite %{{
|
cmd paste-overwrite %{{
|
||||||
set -f
|
mode=$(head -1 ~/.local/share/lf/files)
|
||||||
load=$(lf -remote "load")
|
list=$(sed 1d ~/.local/share/lf/files)
|
||||||
mode=$(echo "$load" | head -1)
|
if [ $mode = 'copy' ]; then
|
||||||
list=$(echo "$load" | sed '1d')
|
cp -r $list .
|
||||||
set -- _ $list; shift
|
elif [ $mode = 'move' ]; then
|
||||||
[ $# -gt 0 ] || exit
|
mv $list .
|
||||||
case $mode in
|
fi
|
||||||
copy)
|
lf -remote 'send clear'
|
||||||
rsync -r "$@" ./
|
|
||||||
;;
|
|
||||||
move)
|
|
||||||
rsync -r --remove-source-files "$@" ./
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
lf -remote 'save\nmove\n'
|
|
||||||
lf -remote "send $id load"
|
|
||||||
lf -remote "send $id echo \"\033[0;32mpasted $# file(s)\033[0m\""
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
cmd fzf_jump ${{
|
cmd fzf_jump ${{
|
||||||
|
|
134
nvim/init.lua
134
nvim/init.lua
|
@ -1,63 +1,85 @@
|
||||||
vim.g.mapleader = ' '
|
vim.g.mapleader = " "
|
||||||
vim.g.maplocalleader = ','
|
vim.g.maplocalleader = ","
|
||||||
vim.o.termguicolors = true
|
vim.o.termguicolors = true
|
||||||
|
|
||||||
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
|
local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||||
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||||
vim.fn.execute('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path)
|
vim.fn.execute("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
require('packer').startup({function(use)
|
require("packer").startup({
|
||||||
use 'wbthomason/packer.nvim'
|
function(use)
|
||||||
use({ 'lewis6991/impatient.nvim',
|
use("wbthomason/packer.nvim")
|
||||||
config = function()
|
use({
|
||||||
require('impatient')
|
"lewis6991/impatient.nvim",
|
||||||
end
|
config = function()
|
||||||
})
|
require("impatient")
|
||||||
use { 'nathom/filetype.nvim' }
|
end,
|
||||||
use { 'neovim/nvim-lspconfig', requires = {'ray-x/lsp_signature.nvim'}, config = [[ require('plugins/lspconfig') ]] }
|
})
|
||||||
use { 'hrsh7th/nvim-cmp',
|
use({ "nathom/filetype.nvim" })
|
||||||
requires = {
|
use({
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
"neovim/nvim-lspconfig",
|
||||||
"hrsh7th/cmp-nvim-lua",
|
requires = { "ray-x/lsp_signature.nvim" },
|
||||||
'hrsh7th/cmp-buffer',
|
config = [[ require('plugins/lspconfig') ]],
|
||||||
'hrsh7th/cmp-path',
|
})
|
||||||
'saadparwaiz1/cmp_luasnip',
|
use({
|
||||||
},
|
"hrsh7th/nvim-cmp",
|
||||||
config = [[ require('plugins/cmp') ]],
|
requires = {
|
||||||
}
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
use { 'L3MON4D3/LuaSnip', requires = { 'rafamadriz/friendly-snippets', }}
|
"hrsh7th/cmp-nvim-lua",
|
||||||
use { 'windwp/nvim-autopairs', config = [[ require('plugins/autopairs') ]] }
|
"hrsh7th/cmp-buffer",
|
||||||
use { 'nvim-telescope/telescope.nvim',
|
"hrsh7th/cmp-path",
|
||||||
requires = {
|
"saadparwaiz1/cmp_luasnip",
|
||||||
{'nvim-lua/plenary.nvim', opt = true,},
|
},
|
||||||
{'nvim-telescope/telescope-fzf-native.nvim', opt = true, run = 'make' }
|
config = [[ require('plugins/cmp') ]],
|
||||||
},
|
})
|
||||||
config = [[ require('plugins/telescope') ]],
|
use({ "L3MON4D3/LuaSnip", requires = { "rafamadriz/friendly-snippets" } })
|
||||||
}
|
use({ "windwp/nvim-autopairs", config = [[ require('plugins/autopairs') ]] })
|
||||||
use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate', config = [[ require('plugins/treesitter') ]] }
|
use({
|
||||||
use { 'ellisonleao/gruvbox.nvim', requires = {'rktjmp/lush.nvim', opt = true}, }
|
"nvim-telescope/telescope.nvim",
|
||||||
use { 'kyazdani42/nvim-web-devicons', after = 'gruvbox.nvim', opt =true, config = [[ require('plugins/webdevicons_nvim') ]] }
|
requires = {
|
||||||
use { 'numToStr/Comment.nvim', require('Comment').setup() }
|
{ "nvim-lua/plenary.nvim", opt = true },
|
||||||
use { 'norcalli/nvim-colorizer.lua', config = [[ require('plugins/colorizer') ]] }
|
{ "nvim-telescope/telescope-fzf-native.nvim", opt = true, run = "make" },
|
||||||
use { 'tpope/vim-fugitive', opt = true, cmd = { "Git", "Gdiff", "Gblame", "Glog", "Git mergetool" }, }
|
},
|
||||||
use { 'lewis6991/gitsigns.nvim', event = { "BufRead", "BufNewFile" }, requires = { 'nvim-lua/plenary.nvim', opt = true, }, config = [[ require('plugins/gitsigns_nvim') ]] }
|
config = [[ require('plugins/telescope') ]],
|
||||||
use {
|
})
|
||||||
'folke/lsp-trouble.nvim', requires = { 'kyazdani42/nvim-web-devicons', opt = true },
|
use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate", config = [[ require('plugins/treesitter') ]] })
|
||||||
config = function()
|
use({ "ellisonleao/gruvbox.nvim", requires = { "rktjmp/lush.nvim", opt = true } })
|
||||||
require("trouble").setup()
|
use({
|
||||||
|
"kyazdani42/nvim-web-devicons",
|
||||||
|
after = "gruvbox.nvim",
|
||||||
|
opt = true,
|
||||||
|
config = [[ require('plugins/webdevicons_nvim') ]],
|
||||||
|
})
|
||||||
|
use({ "numToStr/Comment.nvim", require("Comment").setup() })
|
||||||
|
use({ "norcalli/nvim-colorizer.lua", config = [[ require('plugins/colorizer') ]] })
|
||||||
|
use({ "tpope/vim-fugitive", opt = true, cmd = { "Git", "Gdiff", "Gblame", "Glog", "Git mergetool" } })
|
||||||
|
use({
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
event = { "BufRead", "BufNewFile" },
|
||||||
|
requires = { "nvim-lua/plenary.nvim", opt = true },
|
||||||
|
config = [[ require('plugins/gitsigns_nvim') ]],
|
||||||
|
})
|
||||||
|
use({
|
||||||
|
"folke/lsp-trouble.nvim",
|
||||||
|
requires = { "kyazdani42/nvim-web-devicons", opt = true },
|
||||||
|
config = [[ require('plugins/trouble) ]],
|
||||||
|
cmd = { "LspTrouble" },
|
||||||
|
})
|
||||||
|
use({
|
||||||
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
requires = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
|
||||||
|
config = [[ require('plugins/nulls') ]],
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
cmd = { "LspTrouble" },
|
config = {
|
||||||
}
|
compile_path = vim.fn.stdpath("config") .. "/lua/packer_compiled.lua",
|
||||||
use({ 'jose-elias-alvarez/null-ls.nvim', requires = {'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig'}, config = [[ require('plugins/nulls') ]] })
|
display = {
|
||||||
end,
|
open_fn = function()
|
||||||
config = {
|
return require("packer.util").float({ border = "single" })
|
||||||
compile_path = vim.fn.stdpath('config')..'/lua/packer_compiled.lua',
|
end,
|
||||||
display = {
|
},
|
||||||
open_fn = function()
|
},
|
||||||
return require('packer.util').float({ border = 'single' })
|
})
|
||||||
end
|
require("packer_compiled")
|
||||||
}
|
|
||||||
}})
|
|
||||||
require('packer_compiled')
|
|
||||||
vim.g.did_load_filetypes = 1
|
vim.g.did_load_filetypes = 1
|
||||||
|
|
|
@ -1,55 +1,51 @@
|
||||||
require('nvim-autopairs').setup({
|
require("nvim-autopairs").setup({
|
||||||
check_ts = true,
|
check_ts = true,
|
||||||
ts_config = {
|
ts_config = {
|
||||||
lua = {'string'},-- it will not add pair on that treesitter node
|
lua = { "string" }, -- it will not add pair on that treesitter node
|
||||||
javascript = {'template_string'},
|
javascript = { "template_string" },
|
||||||
|
},
|
||||||
|
fast_wrap = {
|
||||||
|
map = "<M-e>",
|
||||||
|
chars = { "{", "[", "(", '"', "'" },
|
||||||
|
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||||
|
offset = 0, -- Offset from pattern match
|
||||||
|
end_key = "$",
|
||||||
|
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||||
|
check_comma = true,
|
||||||
|
highlight = "Search",
|
||||||
|
highlight_grey = "Comment",
|
||||||
},
|
},
|
||||||
enable_check_bracket_line = true, -- Don't add pairs if it already have a close pairs in same line
|
|
||||||
disable_filetype = { "TelescopePrompt" , "vim" }, --
|
|
||||||
enable_afterquote = false, -- add bracket pairs after quote
|
|
||||||
enable_moveright = true
|
|
||||||
})
|
})
|
||||||
|
|
||||||
local Rule = require('nvim-autopairs.rule')
|
local Rule = require("nvim-autopairs.rule")
|
||||||
require('nvim-autopairs').add_rules({
|
|
||||||
Rule("%", "%", "lua")
|
|
||||||
:with_pair(require('nvim-autopairs.ts-conds').is_ts_node({'string','comment'})),
|
|
||||||
Rule("$", "$", "lua")
|
|
||||||
:with_pair(require('nvim-autopairs.ts-conds').is_not_ts_node({'function'})),
|
|
||||||
Rule(' ', ' ')
|
|
||||||
:with_pair(function (opts)
|
|
||||||
local pair = opts.line:sub(opts.col - 1, opts.col)
|
|
||||||
return vim.tbl_contains({ '()', '[]', '{}' }, pair)
|
|
||||||
end),
|
|
||||||
Rule('( ', ' )')
|
|
||||||
:with_pair(function() return false end)
|
|
||||||
:with_move(function(opts)
|
|
||||||
return opts.prev_char:match('.%)') ~= nil
|
|
||||||
end)
|
|
||||||
:use_key(')'),
|
|
||||||
Rule('{ ', ' }')
|
|
||||||
:with_pair(function() return false end)
|
|
||||||
:with_move(function(opts)
|
|
||||||
return opts.prev_char:match('.%}') ~= nil
|
|
||||||
end)
|
|
||||||
:use_key('}'),
|
|
||||||
Rule('[ ', ' ]')
|
|
||||||
:with_pair(function() return false end)
|
|
||||||
:with_move(function(opts)
|
|
||||||
return opts.prev_char:match('.%]') ~= nil
|
|
||||||
end)
|
|
||||||
:use_key(']'),
|
|
||||||
Rule('%(.*%)%s*%=>$', ' { }', { 'typescript', 'typescriptreact', 'javascript' })
|
|
||||||
:use_regex(true)
|
|
||||||
:set_end_pair_length(2),
|
|
||||||
})
|
|
||||||
|
|
||||||
require("cmp").setup({
|
require("nvim-autopairs").add_rules({
|
||||||
map_complete = true, -- it will auto insert `(` (map_char) after select function or method item
|
Rule(" ", " "):with_pair(function(opts)
|
||||||
auto_select = true, -- automatically select the first item
|
local pair = opts.line:sub(opts.col - 1, opts.col)
|
||||||
insert = false, -- use insert confirm behavior instead of replace
|
return vim.tbl_contains({ "()", "[]", "{}" }, pair)
|
||||||
map_char = { -- modifies the function or method delimiter by filetypes
|
end),
|
||||||
all = '(',
|
Rule("( ", " )")
|
||||||
tex = '{'
|
:with_pair(function()
|
||||||
}
|
return false
|
||||||
|
end)
|
||||||
|
:with_move(function(opts)
|
||||||
|
return opts.prev_char:match(".%)") ~= nil
|
||||||
|
end)
|
||||||
|
:use_key(")"),
|
||||||
|
Rule("{ ", " }")
|
||||||
|
:with_pair(function()
|
||||||
|
return false
|
||||||
|
end)
|
||||||
|
:with_move(function(opts)
|
||||||
|
return opts.prev_char:match(".%}") ~= nil
|
||||||
|
end)
|
||||||
|
:use_key("}"),
|
||||||
|
Rule("[ ", " ]")
|
||||||
|
:with_pair(function()
|
||||||
|
return false
|
||||||
|
end)
|
||||||
|
:with_move(function(opts)
|
||||||
|
return opts.prev_char:match(".%]") ~= nil
|
||||||
|
end)
|
||||||
|
:use_key("]"),
|
||||||
})
|
})
|
||||||
|
|
|
@ -14,42 +14,42 @@ cmp.setup({
|
||||||
formatting = {
|
formatting = {
|
||||||
format = function(entry, vim_item)
|
format = function(entry, vim_item)
|
||||||
vim_item.menu = ({
|
vim_item.menu = ({
|
||||||
nvim_lsp = '[LSP]',
|
nvim_lsp = "[LSP]",
|
||||||
buffer = '[Buffer]',
|
buffer = "[Buffer]",
|
||||||
luasnip = '[Snippet]',
|
luasnip = "[Snippet]",
|
||||||
nvim_lua = '[API]',
|
nvim_lua = "[API]",
|
||||||
path = '[Path]',
|
path = "[Path]",
|
||||||
spell = '[Spell]',
|
spell = "[Spell]",
|
||||||
})[entry.source.name]
|
})[entry.source.name]
|
||||||
vim_item.kind = ({
|
vim_item.kind = ({
|
||||||
Text = ' text',
|
Text = " text",
|
||||||
Method = ' Method',
|
Method = " Method",
|
||||||
Function = ' Function',
|
Function = " Function",
|
||||||
Constructor = ' Constructor',
|
Constructor = " Constructor",
|
||||||
Field = 'ﰠ Field',
|
Field = "ﰠ Field",
|
||||||
Variable = ' Variable',
|
Variable = " Variable",
|
||||||
Class = ' Class',
|
Class = " Class",
|
||||||
Interface = 'ﰮ Interface',
|
Interface = "ﰮ Interface",
|
||||||
Module = ' Module',
|
Module = " Module",
|
||||||
Property = ' Property',
|
Property = " Property",
|
||||||
Unit = ' Unit',
|
Unit = " Unit",
|
||||||
Value = ' Value',
|
Value = " Value",
|
||||||
Enum = ' Enum',
|
Enum = " Enum",
|
||||||
Keyword = ' Keyword',
|
Keyword = " Keyword",
|
||||||
Snippet = ' Snippet',
|
Snippet = " Snippet",
|
||||||
Color = ' Color',
|
Color = " Color",
|
||||||
File = ' File',
|
File = " File",
|
||||||
Reference = ' Reference',
|
Reference = " Reference",
|
||||||
Folder = ' Folder',
|
Folder = " Folder",
|
||||||
EnumMember = ' EnumMember',
|
EnumMember = " EnumMember",
|
||||||
Constant = ' Constant',
|
Constant = " Constant",
|
||||||
Struct = ' Struct',
|
Struct = " Struct",
|
||||||
Event = ' Event',
|
Event = " Event",
|
||||||
Operator = ' Operator',
|
Operator = " Operator",
|
||||||
TypeParameter = ' TypeParameter',
|
TypeParameter = " TypeParameter",
|
||||||
})[vim_item.kind]
|
})[vim_item.kind]
|
||||||
return vim_item
|
return vim_item
|
||||||
end
|
end,
|
||||||
},
|
},
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
|
@ -57,52 +57,50 @@ cmp.setup({
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = {
|
mapping = {
|
||||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
["<C-Space>"] = cmp.mapping(function(_)
|
["<C-Space>"] = cmp.mapping(function(_)
|
||||||
return vim.fn.pumvisible() == 1 and cmp.close() or cmp.complete()
|
return vim.fn.pumvisible() == 1 and cmp.close() or cmp.complete()
|
||||||
end),
|
end),
|
||||||
['<C-e>'] = cmp.mapping.close(),
|
["<C-e>"] = cmp.mapping.close(),
|
||||||
['<CR>'] = cmp.mapping.confirm { select = true,},
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
elseif luasnip and luasnip.expand_or_jumpable() then
|
elseif luasnip and luasnip.expand_or_jumpable() then
|
||||||
luasnip.expand_or_jump()
|
luasnip.expand_or_jump()
|
||||||
elseif has_words_before() then
|
elseif has_words_before() then
|
||||||
vim.api.nvim_feedkeys(
|
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<tab>", true, true, true), "n", true)
|
||||||
vim.api.nvim_replace_termcodes("<tab>", true, true, true),
|
|
||||||
"n",
|
|
||||||
true
|
|
||||||
)
|
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, {
|
||||||
|
"i",
|
||||||
|
"s",
|
||||||
|
}),
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
elseif luasnip and luasnip.jumpable(-1) then
|
elseif luasnip and luasnip.jumpable(-1) then
|
||||||
luasnip.jump(-1)
|
luasnip.jump(-1)
|
||||||
elseif has_words_before() then
|
elseif has_words_before() then
|
||||||
vim.api.nvim_feedkeys(
|
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<s-tab>", true, true, true), "n", true)
|
||||||
vim.api.nvim_replace_termcodes("<s-tab>", true, true, true),
|
|
||||||
"n",
|
|
||||||
true
|
|
||||||
)
|
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, {
|
||||||
|
"i",
|
||||||
|
"s",
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
preselect = cmp.PreselectMode.Item,
|
preselect = cmp.PreselectMode.Item,
|
||||||
sources = {
|
sources = {
|
||||||
{ name = 'path' },
|
{ name = "path" },
|
||||||
{ name = 'buffer', Keyword_length = 5 },
|
{ name = "buffer", Keyword_length = 5 },
|
||||||
},
|
},
|
||||||
experimental = { native_menu = false }
|
experimental = { native_menu = false },
|
||||||
})
|
})
|
||||||
|
|
||||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
require 'colorizer'.setup ({
|
require("colorizer").setup({
|
||||||
'css';
|
"css",
|
||||||
'html';
|
"html",
|
||||||
'javascript';
|
"javascript",
|
||||||
'javascriptreact';
|
"javascriptreact",
|
||||||
'typescript';
|
"typescript",
|
||||||
'typescriptreact';
|
"typescriptreact",
|
||||||
'vim';
|
"vim",
|
||||||
'yaml';
|
"yaml",
|
||||||
'python';
|
"python",
|
||||||
},
|
}, {
|
||||||
{
|
names = false,
|
||||||
names = false;
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,35 +1,35 @@
|
||||||
if not packer_plugins["plenary.nvim"].loaded then
|
if not packer_plugins["plenary.nvim"].loaded then
|
||||||
vim.cmd([[packadd plenary.nvim]])
|
vim.cmd([[packadd plenary.nvim]])
|
||||||
end
|
end
|
||||||
|
|
||||||
require('gitsigns').setup {
|
require("gitsigns").setup({
|
||||||
signcolumn = true,
|
signcolumn = true,
|
||||||
current_line_blame_opts = { delay = 2000, virt_text_pos = 'right_align' },
|
current_line_blame_opts = { delay = 2000, virt_text_pos = "right_align" },
|
||||||
signs = {
|
signs = {
|
||||||
add = {hl = 'GitSignsAdd' , text = '┃', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'},
|
add = { hl = "GitSignsAdd", text = "┃", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
|
||||||
change = {hl = 'GitSignsChange', text = '┃', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
|
change = { hl = "GitSignsChange", text = "┃", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||||
delete = {hl = 'GitSignsDelete', text = '╏', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
|
delete = { hl = "GitSignsDelete", text = "╏", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||||
topdelete = {hl = 'GitSignsDelete', text = '┯', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
|
topdelete = { hl = "GitSignsDelete", text = "┯", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||||
changedelete = {hl = 'GitSignsChange', text = '╍', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
|
changedelete = { hl = "GitSignsChange", text = "╍", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||||
},
|
},
|
||||||
update_debounce = 200,
|
update_debounce = 200,
|
||||||
use_internal_diff = true,
|
use_internal_diff = true,
|
||||||
keymaps = {
|
keymaps = {
|
||||||
noremap = true,
|
noremap = true,
|
||||||
['n <leader>}g'] = { expr = true, "&diff ? '}c' : '<cmd>lua require\"gitsigns\".next_hunk()<CR>'"},
|
["n <leader>}g"] = { expr = true, "&diff ? '}c' : '<cmd>lua require\"gitsigns\".next_hunk()<CR>'" },
|
||||||
['n <leader>{g'] = { expr = true, "&diff ? '{c' : '<cmd>lua require\"gitsigns\".prev_hunk()<CR>'"},
|
["n <leader>{g"] = { expr = true, "&diff ? '{c' : '<cmd>lua require\"gitsigns\".prev_hunk()<CR>'" },
|
||||||
}
|
},
|
||||||
}
|
})
|
||||||
|
|
||||||
vim.g.fugitive_summary_format = "%an\t%s"
|
vim.g.fugitive_summary_format = "%an\t%s"
|
||||||
|
|
||||||
local map = vim.api.nvim_set_keymap
|
local map = vim.api.nvim_set_keymap
|
||||||
local default_opts = {noremap = true, silent = true}
|
local default_opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
map('n', '<Leader>tt', ':Gitsigns toggle_signs<CR>', default_opts)
|
map("n", "<Leader>tt", ":Gitsigns toggle_signs<CR>", default_opts)
|
||||||
map('n', '<Leader>tb', ':Gitsigns toggle_current_line_blame<CR>', default_opts)
|
map("n", "<Leader>tb", ":Gitsigns toggle_current_line_blame<CR>", default_opts)
|
||||||
map('n', '<Leader>ff', ':G<CR>', default_opts)
|
map("n", "<Leader>ff", ":G<CR>", default_opts)
|
||||||
map('n', '<Leader>fc', ':GCheckout<CR>', default_opts)
|
map("n", "<Leader>fc", ":GCheckout<CR>", default_opts)
|
||||||
map('n', '<Leader>fd', ':Gvdiffsplit!<CR>', default_opts)
|
map("n", "<Leader>fd", ":Gvdiffsplit!<CR>", default_opts)
|
||||||
map('n', '<Leader>fh', ':diffget //2<CR>', default_opts)
|
map("n", "<Leader>fh", ":diffget //2<CR>", default_opts)
|
||||||
map('n', '<Leader>fl', ':diffget //3<CR>', default_opts)
|
map("n", "<Leader>fl", ":diffget //3<CR>", default_opts)
|
||||||
|
|
|
@ -11,15 +11,9 @@ sign define LspDiagnosticsSignHint text= texthl=LspDiagnosticsSignHint linehl
|
||||||
]])
|
]])
|
||||||
|
|
||||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||||
underline = true,
|
|
||||||
signs = true,
|
|
||||||
update_in_insert = true,
|
update_in_insert = true,
|
||||||
severity_sort = true,
|
severity_sort = true,
|
||||||
virtual_text = {
|
virtual_text = false,
|
||||||
spacing = 5,
|
|
||||||
severity_limit = "Hint",
|
|
||||||
source = "always",
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
local nvim_lsp = require("lspconfig")
|
local nvim_lsp = require("lspconfig")
|
||||||
|
@ -33,13 +27,6 @@ local on_attach = function(client, bufnr)
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
|
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
|
||||||
vim.api.nvim_buf_set_keymap(
|
|
||||||
bufnr,
|
|
||||||
"n",
|
|
||||||
"<leader>e",
|
|
||||||
"<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>",
|
|
||||||
opts
|
|
||||||
)
|
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "}d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
|
vim.api.nvim_buf_set_keymap(bufnr, "n", "}d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "qq", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
|
vim.api.nvim_buf_set_keymap(bufnr, "n", "qq", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
|
||||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
||||||
|
@ -48,10 +35,7 @@ local on_attach = function(client, bufnr)
|
||||||
require("lsp_signature").on_attach({
|
require("lsp_signature").on_attach({
|
||||||
bind = true,
|
bind = true,
|
||||||
hint_prefix = " ",
|
hint_prefix = " ",
|
||||||
hi_parameter = "ModeMsg",
|
handler_opts = { border = "rounded" },
|
||||||
transparency = 80,
|
|
||||||
trigger_on_newline = false,
|
|
||||||
toggle_key = "<M-f>",
|
|
||||||
})
|
})
|
||||||
if client.resolved_capabilities.document_formatting then
|
if client.resolved_capabilities.document_formatting then
|
||||||
vim.cmd("autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()")
|
vim.cmd("autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()")
|
||||||
|
@ -65,15 +49,8 @@ require("lspconfig/configs").ls_emmet = {
|
||||||
"html",
|
"html",
|
||||||
"css",
|
"css",
|
||||||
"scss",
|
"scss",
|
||||||
"javascript",
|
|
||||||
"javascriptreact",
|
|
||||||
"typescript",
|
|
||||||
"typescriptreact",
|
|
||||||
"haml",
|
|
||||||
"xml",
|
"xml",
|
||||||
"xsl",
|
"xsl",
|
||||||
"pug",
|
|
||||||
"slim",
|
|
||||||
"sass",
|
"sass",
|
||||||
"stylus",
|
"stylus",
|
||||||
"less",
|
"less",
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
vim.cmd([[packadd plenary.nvim]])
|
vim.cmd([[packadd plenary.nvim]])
|
||||||
vim.cmd([[packadd telescope-fzf-native.nvim]])
|
vim.cmd([[packadd telescope-fzf-native.nvim]])
|
||||||
|
|
||||||
local actions = require('telescope.actions')
|
local actions = require("telescope.actions")
|
||||||
local previewers = require('telescope.previewers')
|
local previewers = require("telescope.previewers")
|
||||||
local Job = require('plenary.job')
|
local Job = require("plenary.job")
|
||||||
|
|
||||||
local new_maker = function(filepath, bufnr, opts)
|
local new_maker = function(filepath, bufnr, opts)
|
||||||
filepath = vim.fn.expand(filepath)
|
filepath = vim.fn.expand(filepath)
|
||||||
Job
|
Job
|
||||||
:new({
|
:new({
|
||||||
command = 'file',
|
command = "file",
|
||||||
args = { '--mime-type', '-b', filepath },
|
args = { "--mime-type", "-b", filepath },
|
||||||
on_exit = function(j)
|
on_exit = function(j)
|
||||||
local mime_type = vim.split(j:result()[1], '/')[1]
|
local mime_type = vim.split(j:result()[1], "/")[1]
|
||||||
if mime_type == 'text' then
|
if mime_type == "text" then
|
||||||
previewers.buffer_previewer_maker(filepath, bufnr, opts)
|
previewers.buffer_previewer_maker(filepath, bufnr, opts)
|
||||||
else
|
else
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, { 'BINARY' })
|
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, { "BINARY" })
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
:sync()
|
:sync()
|
||||||
end
|
end
|
||||||
|
|
||||||
require('telescope').setup {
|
require("telescope").setup({
|
||||||
defaults = {
|
defaults = {
|
||||||
prompt_title = " ",
|
prompt_title = " ",
|
||||||
results_title = " ",
|
results_title = " ",
|
||||||
|
@ -40,69 +40,69 @@ require('telescope').setup {
|
||||||
buffers = {
|
buffers = {
|
||||||
mappings = {
|
mappings = {
|
||||||
n = {
|
n = {
|
||||||
['d'] = actions.delete_buffer,
|
["d"] = actions.delete_buffer,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sort_mru = true,
|
sort_mru = true,
|
||||||
preview_title = false,
|
preview_title = false,
|
||||||
},
|
},
|
||||||
find_files = {
|
find_files = {
|
||||||
find_command = {'fd', '-t f', '-c always', '-H'},
|
find_command = { "fd", "-t f", "-c always", "-H" },
|
||||||
hidden = true,
|
hidden = true,
|
||||||
},
|
},
|
||||||
file_browser = {
|
file_browser = {
|
||||||
hidden = true,
|
hidden = true,
|
||||||
},
|
},
|
||||||
lsp_references = {
|
lsp_references = {
|
||||||
initial_mode = 'normal',
|
initial_mode = "normal",
|
||||||
sorting_strategy = 'ascending',
|
sorting_strategy = "ascending",
|
||||||
layout_strategy = 'cursor',
|
layout_strategy = "cursor",
|
||||||
preview_title = false,
|
preview_title = false,
|
||||||
results_title = false,
|
results_title = false,
|
||||||
prompt_title = 'References',
|
prompt_title = "References",
|
||||||
layout_config = {
|
layout_config = {
|
||||||
width = 0.4,
|
width = 0.4,
|
||||||
height = 0.4,
|
height = 0.4,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lsp_code_actions = {
|
lsp_code_actions = {
|
||||||
initial_mode = 'normal',
|
initial_mode = "normal",
|
||||||
sorting_strategy = 'ascending',
|
sorting_strategy = "ascending",
|
||||||
layout_strategy = 'cursor',
|
layout_strategy = "cursor",
|
||||||
preview = false,
|
preview = false,
|
||||||
prompt_title = 'Code Actions',
|
prompt_title = "Code Actions",
|
||||||
results_title = '',
|
results_title = "",
|
||||||
layout_config = {
|
layout_config = {
|
||||||
width = 0.2,
|
width = 0.2,
|
||||||
height = 0.3,
|
height = 0.3,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lsp_range_code_actions = {
|
lsp_range_code_actions = {
|
||||||
initial_mode = 'normal',
|
initial_mode = "normal",
|
||||||
sorting_strategy = 'ascending',
|
sorting_strategy = "ascending",
|
||||||
layout_strategy = 'cursor',
|
layout_strategy = "cursor",
|
||||||
preview = false,
|
preview = false,
|
||||||
prompt_title = 'Code Actions',
|
prompt_title = "Code Actions",
|
||||||
results_title = '',
|
results_title = "",
|
||||||
layout_config = {
|
layout_config = {
|
||||||
width = 0.3,
|
width = 0.3,
|
||||||
height = 0.3,
|
height = 0.3,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lsp_document_diagnostics = {
|
lsp_document_diagnostics = {
|
||||||
initial_mode = 'normal',
|
initial_mode = "normal",
|
||||||
sorting_strategy = 'ascending',
|
sorting_strategy = "ascending",
|
||||||
layout_strategy = 'cursor',
|
layout_strategy = "cursor",
|
||||||
prompt_title = 'Diagnostics',
|
prompt_title = "Diagnostics",
|
||||||
results_title = '',
|
results_title = "",
|
||||||
layout_config = {
|
layout_config = {
|
||||||
width = 0.5,
|
width = 0.5,
|
||||||
height = 0.5,
|
height = 0.5,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lsp_definitions = {
|
lsp_definitions = {
|
||||||
layout_strategy = 'cursor',
|
layout_strategy = "cursor",
|
||||||
prompt_title = 'Definitions',
|
prompt_title = "Definitions",
|
||||||
preview_title = false,
|
preview_title = false,
|
||||||
results_title = false,
|
results_title = false,
|
||||||
layout_config = {
|
layout_config = {
|
||||||
|
@ -113,8 +113,8 @@ require('telescope').setup {
|
||||||
},
|
},
|
||||||
selection_caret = "→",
|
selection_caret = "→",
|
||||||
color_devicons = true,
|
color_devicons = true,
|
||||||
file_ignore_patterns = { 'node_modules', '.git' },
|
file_ignore_patterns = { "node_modules", ".git" },
|
||||||
set_env = {['COLORTERM'] = 'truecolor'},
|
set_env = { ["COLORTERM"] = "truecolor" },
|
||||||
buffer_previewer_maker = new_maker,
|
buffer_previewer_maker = new_maker,
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
|
@ -126,18 +126,18 @@ require('telescope').setup {
|
||||||
},
|
},
|
||||||
n = {
|
n = {
|
||||||
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
|
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
})
|
||||||
require('telescope').load_extension('fzf')
|
require("telescope").load_extension("fzf")
|
||||||
|
|
||||||
local map = vim.api.nvim_set_keymap
|
local map = vim.api.nvim_set_keymap
|
||||||
local default_opts = {noremap = true, silent = true}
|
local default_opts = { noremap = true, silent = true }
|
||||||
map('n', '<F1>', '<cmd>Telescope help_tags<CR>', default_opts)
|
map("n", "<F1>", "<cmd>Telescope help_tags<CR>", default_opts)
|
||||||
map('n', '<F2>', '<cmd>lua require("telescope.builtin").find_files({cwd = "%:h", hidden=true})<CR>', default_opts)
|
map("n", "<F2>", '<cmd>lua require("telescope.builtin").find_files({cwd = "%:h", hidden=true})<CR>', default_opts)
|
||||||
map('n', '<F3>', '<cmd>Telescope file_browser hidden=true<CR>', default_opts)
|
map("n", "<F3>", "<cmd>Telescope file_browser hidden=true<CR>", default_opts)
|
||||||
map('n', '<F4>', '<cmd>Telescope buffers<CR>', default_opts)
|
map("n", "<F4>", "<cmd>Telescope buffers<CR>", default_opts)
|
||||||
map('n', '<M-f>', '<cmd>Telescope live_grep<CR>', default_opts)
|
map("n", "<M-f>", "<cmd>Telescope live_grep<CR>", default_opts)
|
||||||
map('n', '<M-g>', '<cmd>Telescope git_commits<CR>', default_opts)
|
map("n", "<M-g>", "<cmd>Telescope git_commits<CR>", default_opts)
|
||||||
map('n', '<M-S-r>', '<cmd>Telescope resume<CR>', default_opts)
|
map("n", "<M-S-r>", "<cmd>Telescope resume<CR>", default_opts)
|
||||||
|
|
|
@ -1,26 +1,41 @@
|
||||||
require'nvim-treesitter.configs'.setup {
|
require("nvim-treesitter.configs").setup({
|
||||||
ensure_installed = { "bash", "css", "go", "gomod", "html", "json", "json5", "jsonc", "lua", "regex", "scss", "toml", "vim", "yaml" },
|
ensure_installed = {
|
||||||
|
"bash",
|
||||||
|
"css",
|
||||||
|
"go",
|
||||||
|
"gomod",
|
||||||
|
"html",
|
||||||
|
"json",
|
||||||
|
"json5",
|
||||||
|
"jsonc",
|
||||||
|
"lua",
|
||||||
|
"regex",
|
||||||
|
"scss",
|
||||||
|
"toml",
|
||||||
|
"vim",
|
||||||
|
"yaml",
|
||||||
|
},
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
use_languagetree = true,
|
use_languagetree = true,
|
||||||
additional_vim_regex_highlighting = false,
|
additional_vim_regex_highlighting = false,
|
||||||
},
|
},
|
||||||
indent = { enable = true, },
|
indent = { enable = true },
|
||||||
incremental_selection = { enable = true },
|
incremental_selection = { enable = true },
|
||||||
query_linter = {
|
query_linter = {
|
||||||
enable = true,
|
enable = true,
|
||||||
use_virtual_text = true,
|
use_virtual_text = true,
|
||||||
lint_events = { "BufWrite", "CursorHold" }
|
lint_events = { "BufWrite", "CursorHold" },
|
||||||
},
|
},
|
||||||
textobjects = {
|
textobjects = {
|
||||||
select = {
|
select = {
|
||||||
enable = true,
|
enable = true,
|
||||||
lookahead = true,
|
lookahead = true,
|
||||||
keymaps = {
|
keymaps = {
|
||||||
['af'] = '@function.outer',
|
["af"] = "@function.outer",
|
||||||
['if'] = '@function.inner',
|
["if"] = "@function.inner",
|
||||||
['ac'] = '@class.outer',
|
["ac"] = "@class.outer",
|
||||||
['ic'] = '@class.inner',
|
["ic"] = "@class.inner",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
rainbow = {
|
rainbow = {
|
||||||
|
@ -36,5 +51,5 @@ require'nvim-treesitter.configs'.setup {
|
||||||
lua = "-- %s",
|
lua = "-- %s",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
})
|
||||||
|
|
|
@ -2,91 +2,91 @@ local cmd = vim.cmd
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
function M.init()
|
function M.init()
|
||||||
cmd([[packadd nvim-web-devicons]])
|
cmd([[packadd nvim-web-devicons]])
|
||||||
require("nvim-web-devicons").setup({
|
require("nvim-web-devicons").setup({
|
||||||
override = {
|
override = {
|
||||||
html = {
|
html = {
|
||||||
icon = "",
|
icon = "",
|
||||||
color = "#DE8C92",
|
color = "#DE8C92",
|
||||||
name = "html",
|
name = "html",
|
||||||
},
|
},
|
||||||
css = {
|
css = {
|
||||||
icon = "",
|
icon = "",
|
||||||
color = "#61afef",
|
color = "#61afef",
|
||||||
name = "css",
|
name = "css",
|
||||||
},
|
},
|
||||||
js = {
|
js = {
|
||||||
icon = "",
|
icon = "",
|
||||||
color = "#EBCB8B",
|
color = "#EBCB8B",
|
||||||
name = "js",
|
name = "js",
|
||||||
},
|
},
|
||||||
ts = {
|
ts = {
|
||||||
icon = "ﯤ",
|
icon = "ﯤ",
|
||||||
color = "#519ABA",
|
color = "#519ABA",
|
||||||
name = "ts",
|
name = "ts",
|
||||||
},
|
},
|
||||||
rs = {
|
rs = {
|
||||||
icon = "",
|
icon = "",
|
||||||
color = "#FFAA30",
|
color = "#FFAA30",
|
||||||
name = "rs",
|
name = "rs",
|
||||||
},
|
},
|
||||||
kt = {
|
kt = {
|
||||||
icon = "",
|
icon = "",
|
||||||
color = "#ffcb91",
|
color = "#ffcb91",
|
||||||
name = "kt",
|
name = "kt",
|
||||||
},
|
},
|
||||||
png = {
|
png = {
|
||||||
icon = " ",
|
icon = " ",
|
||||||
color = "#BD77DC",
|
color = "#BD77DC",
|
||||||
name = "png",
|
name = "png",
|
||||||
},
|
},
|
||||||
jpg = {
|
jpg = {
|
||||||
icon = " ",
|
icon = " ",
|
||||||
color = "#BD77DC",
|
color = "#BD77DC",
|
||||||
name = "jpg",
|
name = "jpg",
|
||||||
},
|
},
|
||||||
jpeg = {
|
jpeg = {
|
||||||
icon = " ",
|
icon = " ",
|
||||||
color = "#BD77DC",
|
color = "#BD77DC",
|
||||||
name = "jpeg",
|
name = "jpeg",
|
||||||
},
|
},
|
||||||
mp3 = {
|
mp3 = {
|
||||||
icon = "",
|
icon = "",
|
||||||
color = "#C8CCD4",
|
color = "#C8CCD4",
|
||||||
name = "mp3",
|
name = "mp3",
|
||||||
},
|
},
|
||||||
mp4 = {
|
mp4 = {
|
||||||
icon = "",
|
icon = "",
|
||||||
color = "#C8CCD4",
|
color = "#C8CCD4",
|
||||||
name = "mp4",
|
name = "mp4",
|
||||||
},
|
},
|
||||||
out = {
|
out = {
|
||||||
icon = "",
|
icon = "",
|
||||||
color = "#C8CCD4",
|
color = "#C8CCD4",
|
||||||
name = "out",
|
name = "out",
|
||||||
},
|
},
|
||||||
toml = {
|
toml = {
|
||||||
icon = "",
|
icon = "",
|
||||||
color = "#61afef",
|
color = "#61afef",
|
||||||
name = "toml",
|
name = "toml",
|
||||||
},
|
},
|
||||||
lock = {
|
lock = {
|
||||||
icon = "",
|
icon = "",
|
||||||
color = "#DE6B74",
|
color = "#DE6B74",
|
||||||
name = "lock",
|
name = "lock",
|
||||||
},
|
},
|
||||||
zip = {
|
zip = {
|
||||||
icon = "",
|
icon = "",
|
||||||
color = "#EBCB8B",
|
color = "#EBCB8B",
|
||||||
name = "zip",
|
name = "zip",
|
||||||
},
|
},
|
||||||
xz = {
|
xz = {
|
||||||
icon = "",
|
icon = "",
|
||||||
color = "#EBCB8B",
|
color = "#EBCB8B",
|
||||||
name = "xz",
|
name = "xz",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -1,243 +0,0 @@
|
||||||
local windline = require('windline')
|
|
||||||
local helper = require('windline.helpers')
|
|
||||||
local sep = helper.separators
|
|
||||||
local vim_components = require('windline.components.vim')
|
|
||||||
local b_components = require('windline.components.basic')
|
|
||||||
local state = _G.WindLine.state
|
|
||||||
local lsp_comps = require('windline.components.lsp')
|
|
||||||
local git_comps = require('windline.components.git')
|
|
||||||
|
|
||||||
local hl_list = {
|
|
||||||
Black = { 'white', 'black' },
|
|
||||||
White = { 'black', 'white' },
|
|
||||||
Inactive = { 'InactiveFg', 'InactiveBg' },
|
|
||||||
Active = { 'ActiveFg', 'ActiveBg' },
|
|
||||||
}
|
|
||||||
local basic = {}
|
|
||||||
|
|
||||||
basic.divider = { b_components.divider, '' }
|
|
||||||
basic.space = { ' ', '' }
|
|
||||||
basic.bg = { ' ', 'StatusLine' }
|
|
||||||
basic.file_name_inactive = { b_components.full_file_name, hl_list.Inactive }
|
|
||||||
basic.line_col_inactive = { b_components.line_col, hl_list.Inactive }
|
|
||||||
basic.progress_inactive = { b_components.progress, hl_list.Inactive }
|
|
||||||
|
|
||||||
basic.vi_mode = {
|
|
||||||
hl_colors = {
|
|
||||||
Normal = { 'black', 'blue', 'bold' },
|
|
||||||
Insert = { 'black', 'red', 'bold' },
|
|
||||||
Visual = { 'black', 'white', 'bold' },
|
|
||||||
Replace = { 'black', 'blue_light', 'bold' },
|
|
||||||
Command = { 'black', 'magenta', 'bold' },
|
|
||||||
NormalBefore = { 'blue', 'black' },
|
|
||||||
InsertBefore = { 'red', 'black' },
|
|
||||||
VisualBefore = { 'white', 'black' },
|
|
||||||
ReplaceBefore = { 'blue_light', 'black' },
|
|
||||||
CommandBefore = { 'magenta', 'black' },
|
|
||||||
NormalAfter = { 'white', 'blue' },
|
|
||||||
InsertAfter = { 'white', 'red' },
|
|
||||||
VisualAfter = { 'white', 'white' },
|
|
||||||
ReplaceAfter = { 'white', 'blue_light' },
|
|
||||||
CommandAfter = { 'white', 'magenta' },
|
|
||||||
},
|
|
||||||
text = function()
|
|
||||||
return {
|
|
||||||
{ sep.left_rounded, state.mode[2] .. 'Before' },
|
|
||||||
{ state.mode[1] .. ' ', state.mode[2] },
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
basic.lsp_diagnos = {
|
|
||||||
width = 90,
|
|
||||||
hl_colors = {
|
|
||||||
red = { 'red', 'black' },
|
|
||||||
yellow = { 'yellow', 'black' },
|
|
||||||
blue = { 'blue', 'black' },
|
|
||||||
},
|
|
||||||
text = function()
|
|
||||||
if lsp_comps.check_lsp() then
|
|
||||||
return {
|
|
||||||
{ lsp_comps.lsp_error({ format = ' %s' }), 'red' },
|
|
||||||
{ lsp_comps.lsp_warning({ format = ' %s' }), 'yellow' },
|
|
||||||
{ lsp_comps.lsp_hint({ format = ' %s' }), 'blue' },
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return ''
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
local icon_comp = b_components.cache_file_icon({ default = '', hl_colors = {'white','black_light'} })
|
|
||||||
|
|
||||||
basic.file = {
|
|
||||||
hl_colors = {
|
|
||||||
default = { 'white', 'black_light' },
|
|
||||||
},
|
|
||||||
text = function(bufnr)
|
|
||||||
return {
|
|
||||||
{ ' ', 'default' },
|
|
||||||
icon_comp(bufnr),
|
|
||||||
{ ' ', 'default' },
|
|
||||||
{ b_components.cache_file_name('[No Name]', ''), '' },
|
|
||||||
{ b_components.file_modified(' '), '' },
|
|
||||||
-- { b_components.cache_file_size(), '' },
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
basic.right = {
|
|
||||||
hl_colors = {
|
|
||||||
sep_before = { 'black_light', 'white_light' },
|
|
||||||
sep_after = { 'white_light', 'black' },
|
|
||||||
text = { 'black', 'white_light' },
|
|
||||||
},
|
|
||||||
text = function()
|
|
||||||
return {
|
|
||||||
-- { b_components.line_col, 'text' },
|
|
||||||
{ b_components.progress, 'text' },
|
|
||||||
{ sep.right_rounded, 'sep_after' },
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
basic.git = {
|
|
||||||
width = 90,
|
|
||||||
hl_colors = {
|
|
||||||
green = { 'green', 'black' },
|
|
||||||
red = { 'red', 'black' },
|
|
||||||
blue = { 'blue', 'black' },
|
|
||||||
},
|
|
||||||
text = function()
|
|
||||||
if git_comps.is_git() then
|
|
||||||
return {
|
|
||||||
{ ' ', '' },
|
|
||||||
{ git_comps.diff_added({ format = '+%s' }), 'green' },
|
|
||||||
{ git_comps.diff_removed({ format = '-%s' }), 'red' },
|
|
||||||
{ git_comps.diff_changed({ format = '~%s' }), 'blue' },
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return ''
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
basic.logo = {
|
|
||||||
hl_colors = {
|
|
||||||
sep_before = { 'blue', 'black' },
|
|
||||||
default = { 'black', 'blue' },
|
|
||||||
},
|
|
||||||
text = function()
|
|
||||||
return {
|
|
||||||
{ sep.left_rounded, 'sep_before' },
|
|
||||||
{ ' ', 'default' },
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
-- LSP status
|
|
||||||
local lsp_status = require('lsp-status')
|
|
||||||
lsp_status.register_progress()
|
|
||||||
local lsp_config = require('lspconfig')
|
|
||||||
-- Lsp server name .
|
|
||||||
function lspservername()
|
|
||||||
local msg = ''
|
|
||||||
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
|
|
||||||
local clients = vim.lsp.get_active_clients()
|
|
||||||
if next(clients) == nil then return msg end
|
|
||||||
for _, client in ipairs(clients) do
|
|
||||||
local filetypes = client.config.filetypes
|
|
||||||
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
|
|
||||||
return "LSP[" .. client.name .. "]"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return msg
|
|
||||||
end
|
|
||||||
|
|
||||||
basic.lsp = {
|
|
||||||
width = 90,
|
|
||||||
hl_colors = {
|
|
||||||
red = { 'red', 'black' },
|
|
||||||
yellow = { 'yellow', 'black' },
|
|
||||||
blue = { 'blue', 'black' },
|
|
||||||
},
|
|
||||||
text = function()
|
|
||||||
return {
|
|
||||||
{ lsp_status.status, 'red' },
|
|
||||||
{" ", ""},
|
|
||||||
{ lspservername(), 'red' },
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
basic.git_branch = {
|
|
||||||
|
|
||||||
text = function()
|
|
||||||
return {
|
|
||||||
{ git_comps.git_branch(), { 'green', 'black', '' }, 90 },
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
local default = {
|
|
||||||
filetypes = { 'default' },
|
|
||||||
active = {
|
|
||||||
basic.vi_mode,
|
|
||||||
{ git_comps.git_branch(), { 'red', 'black', 'bold' }, 90 },
|
|
||||||
basic.git,
|
|
||||||
basic.file,
|
|
||||||
{ vim_components.search_count(), { 'red', 'black_light' } },
|
|
||||||
{ sep.right_rounded, { 'black_light', 'black' } },
|
|
||||||
basic.divider,
|
|
||||||
basic.lsp_diagnos,
|
|
||||||
basic.lsp,
|
|
||||||
{ ' ', hl_list.Black },
|
|
||||||
basic.right,
|
|
||||||
-- { ' ', hl_list.Black },
|
|
||||||
},
|
|
||||||
in_active = {
|
|
||||||
basic.file_name_inactive,
|
|
||||||
basic.divider,
|
|
||||||
basic.divider,
|
|
||||||
basic.line_col_inactive,
|
|
||||||
{ '', { 'white', 'InactiveBg' } },
|
|
||||||
basic.progress_inactive,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
local quickfix = {
|
|
||||||
filetypes = { 'qf', 'Trouble' },
|
|
||||||
active = {
|
|
||||||
{ '🚦 Quickfix ', { 'white', 'black' } },
|
|
||||||
{ helper.separators.slant_right, { 'black', 'black_light' } },
|
|
||||||
{
|
|
||||||
function()
|
|
||||||
return vim.fn.getqflist({ title = 0 }).title
|
|
||||||
end,
|
|
||||||
{ 'cyan', 'black_light' },
|
|
||||||
},
|
|
||||||
{ ' Total : %L ', { 'cyan', 'black_light' } },
|
|
||||||
{ helper.separators.slant_right, { 'black_light', 'InactiveBg' } },
|
|
||||||
{ ' ', { 'InactiveFg', 'InactiveBg' } },
|
|
||||||
basic.divider,
|
|
||||||
{ helper.separators.slant_right, { 'InactiveBg', 'black' } },
|
|
||||||
{ '🧛 ', { 'white', 'black' } },
|
|
||||||
},
|
|
||||||
show_in_active = true,
|
|
||||||
}
|
|
||||||
|
|
||||||
local explorer = {
|
|
||||||
filetypes = { 'fern', 'NvimTree', 'lir' },
|
|
||||||
active = {
|
|
||||||
{ ' ', { 'white', 'black' } },
|
|
||||||
{ helper.separators.slant_right, { 'black', 'black_light' } },
|
|
||||||
{ b_components.divider, '' },
|
|
||||||
{ b_components.file_name(''), { 'white', 'black_light' } },
|
|
||||||
},
|
|
||||||
show_in_active = true,
|
|
||||||
}
|
|
||||||
windline.setup({
|
|
||||||
colors_name = function(colors)
|
|
||||||
-- ADD MORE COLOR HERE ----
|
|
||||||
return colors
|
|
||||||
end,
|
|
||||||
statuslines = {
|
|
||||||
default,
|
|
||||||
quickfix,
|
|
||||||
explorer,
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -15,14 +15,18 @@ if !exists('autocommands_loaded') && has('autocmd')
|
||||||
au TextYankPost * silent! lua vim.highlight.on_yank{timeout = 80, on_visual=true}
|
au TextYankPost * silent! lua vim.highlight.on_yank{timeout = 80, on_visual=true}
|
||||||
au FileType TelescopePrompt lua require('cmp').setup.buffer { enabled = false }
|
au FileType TelescopePrompt lua require('cmp').setup.buffer { enabled = false }
|
||||||
au BufEnter * set fo-=c fo-=r fo-=o
|
au BufEnter * set fo-=c fo-=r fo-=o
|
||||||
|
au CursorHold,CursorHoldI * lua vim.lsp.diagnostic.show_line_diagnostics({focusable=false})
|
||||||
aug END
|
aug END
|
||||||
|
|
||||||
aug OnSave
|
aug OnSave
|
||||||
au BufWritePre * if index(ftToIgnore, &ft) < 0 | :%s/\s\+$//e
|
au BufWritePre * if index(ftToIgnore, &ft) < 0 | :%s/\s\+$//e
|
||||||
au BufWritePre * silent! lua vim.lsp.buf.formatting_sync()
|
|
||||||
au BufWritePost init.lua PackerSync
|
au BufWritePost init.lua PackerSync
|
||||||
au BufWritePost *xresources !xrdb %
|
|
||||||
au BufWritePost *sxhkdrc !pkill -USR1 sxhkd
|
|
||||||
au QuitPre * if empty(&buftype) | lclose | endif
|
au QuitPre * if empty(&buftype) | lclose | endif
|
||||||
aug END
|
aug END
|
||||||
|
|
||||||
|
let statusline_blacklist = ['terminal', 'fugitive', 'vista', 'diagnostics', 'qf']
|
||||||
|
aug StatusLine
|
||||||
|
au WinEnter,BufEnter * if index(statusline_blacklist, &ft) < 0 | setlocal statusline=%!v:lua.StatusLine()
|
||||||
|
au WinLeave,BufLeave * if index(statusline_blacklist, &ft) < 0 | setlocal statusline=%!v:lua.StatusLineInactive()
|
||||||
|
aug END
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
local disabled_builtin_plugins = {
|
local disabled_builtin_plugins = {
|
||||||
'gzip',
|
"gzip",
|
||||||
'zip',
|
"zip",
|
||||||
'zipPlugin',
|
"zipPlugin",
|
||||||
'tar',
|
"tar",
|
||||||
'tarPlugin',
|
"tarPlugin",
|
||||||
'getscript',
|
"getscript",
|
||||||
"getscriptPlugin",
|
"getscriptPlugin",
|
||||||
"vimball",
|
"vimball",
|
||||||
"vimballPlugin",
|
"vimballPlugin",
|
||||||
|
@ -22,11 +22,11 @@ local disabled_providers = {
|
||||||
"ruby",
|
"ruby",
|
||||||
"node",
|
"node",
|
||||||
"python",
|
"python",
|
||||||
"perl"
|
"perl",
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, provider in pairs(disabled_providers) do
|
for _, provider in pairs(disabled_providers) do
|
||||||
vim.g["loaded_" .. provider .. "_provider"] = 0
|
vim.g["loaded_" .. provider .. "_provider"] = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.g.python3_host_prog = '/bin/python3'
|
vim.g.python3_host_prog = "/bin/python3"
|
||||||
|
|
|
@ -1,60 +1,166 @@
|
||||||
local function get_git_status()
|
-- setup truncation limits
|
||||||
local head = vim.b.gitsigns_head or ''
|
local truncation_limit = 120
|
||||||
local signs = vim.b.gitsigns_status or ''
|
|
||||||
if signs == '' then
|
-- is buffer horizontally truncated
|
||||||
if head == '-' or head == '' then
|
Is_htruncated = function(width)
|
||||||
return ''
|
local current_width = vim.api.nvim_win_get_width(0)
|
||||||
end
|
return current_width < width
|
||||||
return string.format(' %s', head)
|
|
||||||
end
|
|
||||||
return string.format(' %s %s', head, signs)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_lsp_info()
|
-- diagnostics symbol config
|
||||||
if vim.lsp.buf.server_ready() then
|
local symbol_config = {
|
||||||
local hints = vim.lsp.diagnostic.get_count(0, 'Hint')
|
indicator_hint = " ",
|
||||||
local warnings = vim.lsp.diagnostic.get_count(0, 'Warning')
|
indicator_info = " ",
|
||||||
local errors = vim.lsp.diagnostic.get_count(0, 'Error')
|
indicator_warning = " ",
|
||||||
return string.format(' :%d :%d :%d ', hints, warnings, errors)
|
indicator_error = " ",
|
||||||
|
}
|
||||||
|
|
||||||
|
-- statusline colors
|
||||||
|
local statusline_colors = {
|
||||||
|
active = "%#StatusLine#",
|
||||||
|
inactive = "%#StatusLineNC#",
|
||||||
|
git = "%#diffChanged#",
|
||||||
|
err = "%#LspDiagnosticsDefaultError#",
|
||||||
|
warn = "%#LspDiagnosticsDefaultWarning#",
|
||||||
|
nfo = "%#LspDiagnosticsDefaultInformation#",
|
||||||
|
hnt = "%#LspDiagnosticsDefaultHint#",
|
||||||
|
line_col = "%#Delimiter#",
|
||||||
|
percentage = "%#Delimiter#",
|
||||||
|
}
|
||||||
|
|
||||||
|
-- get git information of current file
|
||||||
|
local get_git_status = function()
|
||||||
|
local meta = {}
|
||||||
|
local gitsigns_summary = vim.b.gitsigns_status_dict
|
||||||
|
if not gitsigns_summary then
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
meta["branch"] = gitsigns_summary["head"]
|
||||||
|
meta["added"] = gitsigns_summary["added"]
|
||||||
|
meta["modified"] = gitsigns_summary["changed"]
|
||||||
|
meta["removed"] = gitsigns_summary["removed"]
|
||||||
|
if Is_htruncated(truncation_limit) then
|
||||||
|
return string.format(" %s", meta["branch"])
|
||||||
else
|
else
|
||||||
return ''
|
return string.format(" %s +%s ~%s -%s", meta["branch"], meta["added"], meta["modified"], meta["removed"])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function is_modified()
|
-- get current file name
|
||||||
if vim.bo.modified then
|
local get_filename = function()
|
||||||
return ' [+]'
|
if Is_htruncated(truncation_limit) then
|
||||||
|
return "%t "
|
||||||
end
|
end
|
||||||
return ''
|
return "%<%F "
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_file_info()
|
-- get current line/col
|
||||||
return ' %l:%c'
|
local get_line_col = function()
|
||||||
|
return " %l:%c"
|
||||||
end
|
end
|
||||||
|
|
||||||
function Get_flags()
|
-- get current percentage through file
|
||||||
return '%h%w%m%r'
|
local get_percentage = function()
|
||||||
|
if Is_htruncated(truncation_limit) then
|
||||||
|
return ""
|
||||||
|
else
|
||||||
|
return " %p%%"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Get_file_name()
|
local get_flags = function()
|
||||||
return '%<%F'
|
return "%h%w%m "
|
||||||
end
|
end
|
||||||
|
|
||||||
function Color_as(value, group)
|
-- get current file diagnostics
|
||||||
return string.format('%%#%s#%s', group, value)
|
local get_diagnostics = function()
|
||||||
|
if #vim.lsp.buf_get_clients(0) == 0 then
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
|
||||||
|
local status_parts = {}
|
||||||
|
local errors = vim.lsp.diagnostic.get_count(0, [[Error]])
|
||||||
|
|
||||||
|
if errors > 0 then
|
||||||
|
table.insert(status_parts, statusline_colors.err .. symbol_config.indicator_error .. errors)
|
||||||
|
end
|
||||||
|
|
||||||
|
if not Is_htruncated(truncation_limit) then
|
||||||
|
local warnings = vim.lsp.diagnostic.get_count(0, [[Warning]])
|
||||||
|
local hints = vim.lsp.diagnostic.get_count(0, [[Hint]])
|
||||||
|
local infos = vim.lsp.diagnostic.get_count(0, [[Info]])
|
||||||
|
|
||||||
|
if warnings > 0 then
|
||||||
|
table.insert(status_parts, statusline_colors.warn .. symbol_config.indicator_warning .. warnings)
|
||||||
|
end
|
||||||
|
|
||||||
|
if infos > 0 then
|
||||||
|
table.insert(status_parts, statusline_colors.nfo .. symbol_config.indicator_info .. infos)
|
||||||
|
end
|
||||||
|
|
||||||
|
if hints > 0 then
|
||||||
|
table.insert(status_parts, statusline_colors.hnt .. symbol_config.indicator_hint .. hints)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local status_diagnostics = vim.trim(table.concat(status_parts, " "))
|
||||||
|
if status_diagnostics ~= "" then
|
||||||
|
return status_diagnostics .. " "
|
||||||
|
end
|
||||||
|
return ""
|
||||||
end
|
end
|
||||||
|
|
||||||
local status_line_template = '%s%s%%=%s%%=%s%s'
|
-- inactive statusline
|
||||||
|
local statusline_inactive = function()
|
||||||
|
local flags = get_flags()
|
||||||
|
local filename = get_filename()
|
||||||
|
local line_col = get_line_col()
|
||||||
|
local percentage = get_percentage()
|
||||||
|
|
||||||
function RenderStatusLine()
|
return table.concat({
|
||||||
return string.format(
|
statusline_colors.inactive,
|
||||||
status_line_template,
|
flags,
|
||||||
Color_as(get_lsp_info(), 'diffChanged'),
|
filename,
|
||||||
Color_as(Get_flags(), 'StatusLine'),
|
"%=% ",
|
||||||
Color_as(Get_file_name(), 'StatusLine'),
|
line_col,
|
||||||
Color_as(get_git_status(), 'diffChanged'),
|
percentage,
|
||||||
Color_as(get_file_info(), 'StatusLineNC')
|
})
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.o.statusline = '%!v:lua.RenderStatusLine()'
|
-- active statusline
|
||||||
|
local statusline_normal = function()
|
||||||
|
local diagnostics = get_diagnostics()
|
||||||
|
local flags = statusline_colors.active .. get_flags()
|
||||||
|
local filename = statusline_colors.active .. get_filename()
|
||||||
|
local git = statusline_colors.git .. get_git_status()
|
||||||
|
local line_col = statusline_colors.line_col .. get_line_col()
|
||||||
|
local percentage = statusline_colors.percentage .. get_percentage()
|
||||||
|
|
||||||
|
return table.concat({
|
||||||
|
diagnostics,
|
||||||
|
flags,
|
||||||
|
"%=% ",
|
||||||
|
filename,
|
||||||
|
"%=% ",
|
||||||
|
git,
|
||||||
|
line_col,
|
||||||
|
percentage,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- module
|
||||||
|
M = {}
|
||||||
|
|
||||||
|
-- generate statusline
|
||||||
|
StatusLine = function()
|
||||||
|
return statusline_normal()
|
||||||
|
end
|
||||||
|
M.StatusLine = StatusLine
|
||||||
|
|
||||||
|
-- generate inactive statusline
|
||||||
|
StatusLineInactive = function()
|
||||||
|
return statusline_inactive()
|
||||||
|
end
|
||||||
|
M.StatusLineInactive = StatusLineInactive
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
21
xbpaketes
21
xbpaketes
|
@ -1,6 +1,7 @@
|
||||||
MangoHud-0.6.5_1
|
MangoHud-0.6.5_1
|
||||||
SDL-1.2.15_12
|
SDL-1.2.15_12
|
||||||
SDL_mixer-1.2.12_14
|
SDL_mixer-1.2.12_14
|
||||||
|
StyLua-0.11.1_1
|
||||||
alacritty-0.9.0_1
|
alacritty-0.9.0_1
|
||||||
alsa-plugins-1.2.5_1
|
alsa-plugins-1.2.5_1
|
||||||
alsa-plugins-ffmpeg-1.2.5_1
|
alsa-plugins-ffmpeg-1.2.5_1
|
||||||
|
@ -18,7 +19,7 @@ base-system-0.114_1
|
||||||
bat-0.18.3_1
|
bat-0.18.3_1
|
||||||
blender-2.93.5_1
|
blender-2.93.5_1
|
||||||
bspwm-0.9.10_1
|
bspwm-0.9.10_1
|
||||||
catgirl-1.9a_1
|
catgirl-1.9a_2
|
||||||
cgo-0.6.1_1
|
cgo-0.6.1_1
|
||||||
chrony-4.1_1
|
chrony-4.1_1
|
||||||
cmake-3.21.1_1
|
cmake-3.21.1_1
|
||||||
|
@ -30,7 +31,7 @@ dkms-2.8.4_2
|
||||||
droidcam-1.7.3_1
|
droidcam-1.7.3_1
|
||||||
dunst-1.6.1_1
|
dunst-1.6.1_1
|
||||||
elinks-0.14.3_1
|
elinks-0.14.3_1
|
||||||
fcitx-4.2.9.8_4
|
fcitx-4.2.9.8_5
|
||||||
fcitx-configtool-0.4.10_2
|
fcitx-configtool-0.4.10_2
|
||||||
fcitx-mozc-2.26.4472.102_2
|
fcitx-mozc-2.26.4472.102_2
|
||||||
fd-8.2.1_1
|
fd-8.2.1_1
|
||||||
|
@ -41,7 +42,7 @@ figlet-fonts-20150508_4
|
||||||
file-roller-3.40.0_1
|
file-roller-3.40.0_1
|
||||||
firefox-94.0_1
|
firefox-94.0_1
|
||||||
font-misc-misc-1.1.2_7
|
font-misc-misc-1.1.2_7
|
||||||
fzf-0.27.3_1
|
fzf-0.28.0_2
|
||||||
git-2.33.1_1
|
git-2.33.1_1
|
||||||
git-libsecret-2.33.1_1
|
git-libsecret-2.33.1_1
|
||||||
glu-9.0.2_2
|
glu-9.0.2_2
|
||||||
|
@ -51,7 +52,7 @@ gnome-ssh-askpass-8.8p1_1
|
||||||
gnupg2-2.2.32_1
|
gnupg2-2.2.32_1
|
||||||
go-1.17.2_1
|
go-1.17.2_1
|
||||||
golangci-lint-1.42.1_1
|
golangci-lint-1.42.1_1
|
||||||
gopls-0.7.2_1
|
gopls-0.7.3_1
|
||||||
grub-2.06_2
|
grub-2.06_2
|
||||||
gzdoom-4.7.1_1
|
gzdoom-4.7.1_1
|
||||||
highlight-4.1_2
|
highlight-4.1_2
|
||||||
|
@ -64,8 +65,8 @@ keychain-2.8.5_2
|
||||||
krita-4.4.8_2
|
krita-4.4.8_2
|
||||||
lf-r26_1
|
lf-r26_1
|
||||||
libdrm-32bit-2.4.107_1
|
libdrm-32bit-2.4.107_1
|
||||||
libfcitx-gtk-4.2.9.8_4
|
libfcitx-gtk-4.2.9.8_5
|
||||||
libfcitx-gtk3-4.2.9.8_4
|
libfcitx-gtk3-4.2.9.8_5
|
||||||
libgcc-32bit-10.2.1pre1_3
|
libgcc-32bit-10.2.1pre1_3
|
||||||
libglvnd-32bit-1.3.3_1
|
libglvnd-32bit-1.3.3_1
|
||||||
libstdc++-32bit-10.2.1pre1_3
|
libstdc++-32bit-10.2.1pre1_3
|
||||||
|
@ -88,8 +89,9 @@ mosh-1.3.2_23
|
||||||
mpv-0.34.0_1
|
mpv-0.34.0_1
|
||||||
msmtp-1.8.18_1
|
msmtp-1.8.18_1
|
||||||
mumble-1.3.4_7
|
mumble-1.3.4_7
|
||||||
|
ncdu-1.16_1
|
||||||
ncurses-devel-6.2_4
|
ncurses-devel-6.2_4
|
||||||
neomutt-20210205_2
|
neomutt-20211029_1
|
||||||
neovim-0.5.1_2
|
neovim-0.5.1_2
|
||||||
newsboat-2.25_1
|
newsboat-2.25_1
|
||||||
nfs-utils-2.5.4_1
|
nfs-utils-2.5.4_1
|
||||||
|
@ -117,12 +119,12 @@ rofi-emoji-2.2.0_1
|
||||||
rsync-3.2.3_3
|
rsync-3.2.3_3
|
||||||
runit-nftables-20200123_2
|
runit-nftables-20200123_2
|
||||||
setxkbmap-1.3.2_1
|
setxkbmap-1.3.2_1
|
||||||
shellcheck-0.7.2_2
|
shellcheck-0.8.0_1
|
||||||
shfmt-3.4.0_1
|
shfmt-3.4.0_1
|
||||||
simple-mtpfs-0.4.0_1
|
simple-mtpfs-0.4.0_1
|
||||||
snooze-0.5_1
|
snooze-0.5_1
|
||||||
socklog-void-20200115_2
|
socklog-void-20200115_2
|
||||||
steam-1.0.0.72_1
|
steam-1.0.0.73_1
|
||||||
sv-netmount-0.1_3
|
sv-netmount-0.1_3
|
||||||
sxhkd-0.6.2_1
|
sxhkd-0.6.2_1
|
||||||
sxiv-26_1
|
sxiv-26_1
|
||||||
|
@ -163,4 +165,5 @@ zathura-cb-0.1.9_1
|
||||||
zathura-pdf-mupdf-0.3.7_3
|
zathura-pdf-mupdf-0.3.7_3
|
||||||
zip-3.0_6
|
zip-3.0_6
|
||||||
zsh-5.8_2
|
zsh-5.8_2
|
||||||
|
zsh-history-substring-search-1.0.2_2
|
||||||
zsh-syntax-highlighting-0.7.1_3
|
zsh-syntax-highlighting-0.7.1_3
|
||||||
|
|
11
zsh/.zshrc
11
zsh/.zshrc
|
@ -27,10 +27,14 @@ setopt PROMPT_SUBST
|
||||||
|
|
||||||
[ -n "$DISPLAY" ] && source ${ZDOTDIR}/tmux.zsh
|
[ -n "$DISPLAY" ] && source ${ZDOTDIR}/tmux.zsh
|
||||||
|
|
||||||
|
source $XDG_DATA_HOME/lscolors.sh
|
||||||
|
source "$ZDOTDIR/other.zsh"
|
||||||
|
|
||||||
foreach programa (
|
foreach programa (
|
||||||
doc/fzf/completion.zsh
|
fzf/completion.zsh
|
||||||
doc/fzf/key-bindings.zsh
|
fzf/key-bindings.zsh
|
||||||
zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
|
zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
|
||||||
|
zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
|
||||||
) {
|
) {
|
||||||
source /usr/share/$programa
|
source /usr/share/$programa
|
||||||
}
|
}
|
||||||
|
@ -38,6 +42,3 @@ foreach programa (
|
||||||
for f in ${ZDOTDIR}/conf/*; do
|
for f in ${ZDOTDIR}/conf/*; do
|
||||||
source "${f}"
|
source "${f}"
|
||||||
done
|
done
|
||||||
|
|
||||||
source $XDG_DATA_HOME/lscolors.sh
|
|
||||||
source "$ZDOTDIR/other.zsh"
|
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
function precmd() {
|
|
||||||
if [ -z "$NEW_LINE_BEFORE_PROMPT" ]; then
|
|
||||||
NEW_LINE_BEFORE_PROMPT=1
|
|
||||||
elif [ "$NEW_LINE_BEFORE_PROMPT" -eq 1 ]; then
|
|
||||||
echo "\n"
|
|
||||||
fi
|
|
||||||
print -Pn "\e]0;zsh %(1j,%j job%(2j|s|); ,)%2~\a"
|
|
||||||
}
|
|
||||||
|
|
||||||
function preexec {
|
|
||||||
printf "\033]0;%s\a" "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
autoload -Uz vcs_info
|
|
||||||
precmd_vcs_info() { vcs_info }
|
|
||||||
precmd_functions+=( precmd_vcs_info )
|
|
||||||
setopt prompt_subst
|
|
||||||
zstyle ':vcs_info:git:*' formats '%b'
|
|
||||||
zstyle ':vcs_info:*' enable git
|
|
||||||
|
|
||||||
function () {
|
|
||||||
if [[ $EUID == 0 ]]; then
|
|
||||||
local SUFFIX='%(?,%F{yellow},%F{red})%n%f:'
|
|
||||||
else
|
|
||||||
local SUFFIX='%(?,%F{yellow},%F{red})>%f'
|
|
||||||
fi
|
|
||||||
|
|
||||||
PS1="%B${SUFFIX}%b "
|
|
||||||
if [[ -n $TMUX ]]; then
|
|
||||||
export RPS1="%F{green}\$vcs_info_msg_0_%f %B%(?..%{%F{red}%}(%?%)%{%f%})"
|
|
||||||
else
|
|
||||||
export RPS1="%F{green}\$vcs_info_msg_0_%f %B%(?..%{%F{red}%}(%?%)%{%f%}) %b%F{12}%2~%f"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
export SPROMPT="zsh: correct %F{red}'%R'%f to %F{green}'%r'%f [%B%Uy%u%bes, %B%Un%u%bo, %B%Ue%u%bdit, %B%Ua%u%bbort]? "
|
|
||||||
|
|
||||||
function zle-keymap-select {
|
|
||||||
case $KEYMAP in
|
|
||||||
vicmd) echo -ne '\e[2 q';;
|
|
||||||
viins|main) echo -ne '\e[6 q';;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
zle -N zle-keymap-select
|
|
||||||
|
|
||||||
_fix_cursor() {
|
|
||||||
echo -ne '\e[6 q'
|
|
||||||
}
|
|
||||||
|
|
||||||
precmd_functions+=(_fix_cursor)
|
|
|
@ -1,20 +1,9 @@
|
||||||
foreach plugin (
|
foreach plugin (
|
||||||
zsh-autopair/autopair.plugin.zsh
|
zsh-autopair/autopair.plugin.zsh
|
||||||
zsh-system-clipboard/zsh-system-clipboard.plugin.zsh
|
zsh-system-clipboard/zsh-system-clipboard.plugin.zsh
|
||||||
zsh-history-substring-search/zsh-history-substring-search.plugin.zsh
|
|
||||||
# forgit/forgit.plugin.zsh
|
|
||||||
) {
|
) {
|
||||||
source $ZDOTDIR/conf/$plugin
|
source $ZDOTDIR/conf/$plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
typeset -A ZSH_HIGHLIGHT_REGEXP
|
|
||||||
ZSH_HIGHLIGHT_REGEXP+=(' -{1,2}[a-zA-Z0-9_-]*' fg=008)
|
|
||||||
|
|
||||||
# FORGIT_COPY_CMD='xclip -selection clipboard'
|
|
||||||
|
|
||||||
# FORGIT_LOG_FZF_OPTS='
|
|
||||||
# --bind="ctrl-e:execute(echo {} | grep -Eo [a-f0-9]+ | head -1 | xargs git show | vim -)"
|
|
||||||
# '
|
|
||||||
|
|
||||||
HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1
|
HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1
|
||||||
# typeset -g ZSH_SYSTEM_CLIPBOARD_TMUX_SUPPORT='true'
|
typeset -g ZSH_SYSTEM_CLIPBOARD_TMUX_SUPPORT='true'
|
||||||
|
|
|
@ -1,509 +0,0 @@
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
# Description
|
|
||||||
# -----------
|
|
||||||
#
|
|
||||||
# Completion script for git-extras (https://github.com/tj/git-extras).
|
|
||||||
#
|
|
||||||
# This depends on and reuses some of the internals of the _git completion
|
|
||||||
# function that ships with zsh itself. It will not work with the _git that ships
|
|
||||||
# with git.
|
|
||||||
#
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
# Authors
|
|
||||||
# -------
|
|
||||||
#
|
|
||||||
# * Alexis GRIMALDI (https://github.com/agrimaldi)
|
|
||||||
# * spacewander (https://github.com/spacewander)
|
|
||||||
#
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
# Inspirations
|
|
||||||
# -----------
|
|
||||||
#
|
|
||||||
# * git-extras (https://github.com/tj/git-extras)
|
|
||||||
# * git-flow-completion (https://github.com/bobthecow/git-flow-completion)
|
|
||||||
#
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
# Internal functions
|
|
||||||
# These are a lot like their __git_* equivalents inside _git
|
|
||||||
|
|
||||||
__gitex_command_successful () {
|
|
||||||
if (( ${#*:#0} > 0 )); then
|
|
||||||
_message 'not a git repository'
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
__gitex_commits() {
|
|
||||||
declare -A commits
|
|
||||||
git log --oneline -15 | sed 's/\([[:alnum:]]\{7\}\) /\1:/' | while read commit
|
|
||||||
do
|
|
||||||
hash=$(echo $commit | cut -d':' -f1)
|
|
||||||
commits[$hash]="$commit"
|
|
||||||
done
|
|
||||||
local ret=1
|
|
||||||
_describe -t commits commit commits && ret=0
|
|
||||||
}
|
|
||||||
|
|
||||||
__gitex_remote_names() {
|
|
||||||
local expl
|
|
||||||
declare -a remote_names
|
|
||||||
remote_names=(${(f)"$(_call_program remotes git remote 2>/dev/null)"})
|
|
||||||
__git_command_successful || return
|
|
||||||
_wanted remote-names expl remote-name compadd $* - $remote_names
|
|
||||||
}
|
|
||||||
|
|
||||||
__gitex_tag_names() {
|
|
||||||
local expl
|
|
||||||
declare -a tag_names
|
|
||||||
tag_names=(${${(f)"$(_call_program tags git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
|
|
||||||
__git_command_successful || return
|
|
||||||
_wanted tag-names expl tag-name compadd $* - $tag_names
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
__gitex_branch_names() {
|
|
||||||
local expl
|
|
||||||
declare -a branch_names
|
|
||||||
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
|
|
||||||
__git_command_successful || return
|
|
||||||
_wanted branch-names expl branch-name compadd $* - $branch_names
|
|
||||||
}
|
|
||||||
|
|
||||||
__gitex_specific_branch_names() {
|
|
||||||
local expl
|
|
||||||
declare -a branch_names
|
|
||||||
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/"$1" 2>/dev/null)"}#refs/heads/$1/})
|
|
||||||
__git_command_successful || return
|
|
||||||
_wanted branch-names expl branch-name compadd - $branch_names
|
|
||||||
}
|
|
||||||
|
|
||||||
__gitex_chore_branch_names() {
|
|
||||||
__gitex_specific_branch_names 'chore'
|
|
||||||
}
|
|
||||||
|
|
||||||
__gitex_feature_branch_names() {
|
|
||||||
__gitex_specific_branch_names 'feature'
|
|
||||||
}
|
|
||||||
|
|
||||||
__gitex_refactor_branch_names() {
|
|
||||||
__gitex_specific_branch_names 'refactor'
|
|
||||||
}
|
|
||||||
|
|
||||||
__gitex_bug_branch_names() {
|
|
||||||
__gitex_specific_branch_names 'bug'
|
|
||||||
}
|
|
||||||
|
|
||||||
__gitex_submodule_names() {
|
|
||||||
local expl
|
|
||||||
declare -a submodule_names
|
|
||||||
submodule_names=(${(f)"$(_call_program branchrefs git submodule status | awk '{print $2}')"}) # '
|
|
||||||
__git_command_successful || return
|
|
||||||
_wanted submodule-names expl submodule-name compadd $* - $submodule_names
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
__gitex_author_names() {
|
|
||||||
local expl
|
|
||||||
declare -a author_names
|
|
||||||
author_names=(${(f)"$(_call_program branchrefs git log --format='%aN' | sort -u)"})
|
|
||||||
__git_command_successful || return
|
|
||||||
_wanted author-names expl author-name compadd $* - $author_names
|
|
||||||
}
|
|
||||||
|
|
||||||
# subcommands
|
|
||||||
_git-authors() {
|
|
||||||
_arguments -C \
|
|
||||||
'(--list -l)'{--list,-l}'[show authors]' \
|
|
||||||
'--no-email[without email]' \
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-bug() {
|
|
||||||
local curcontext=$curcontext state line ret=1
|
|
||||||
declare -A opt_args
|
|
||||||
|
|
||||||
_arguments -C \
|
|
||||||
': :->command' \
|
|
||||||
'*:: :->option-or-argument' && ret=0
|
|
||||||
|
|
||||||
case $state in
|
|
||||||
(command)
|
|
||||||
declare -a commands
|
|
||||||
commands=(
|
|
||||||
'finish:merge bug into the current branch'
|
|
||||||
)
|
|
||||||
_describe -t commands command commands && ret=0
|
|
||||||
;;
|
|
||||||
(option-or-argument)
|
|
||||||
curcontext=${curcontext%:*}-$line[1]:
|
|
||||||
case $line[1] in
|
|
||||||
(finish)
|
|
||||||
_arguments -C \
|
|
||||||
':branch-name:__gitex_bug_branch_names'
|
|
||||||
;;
|
|
||||||
-r|--remote )
|
|
||||||
_arguments -C \
|
|
||||||
':remote-name:__gitex_remote_names'
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
return 0
|
|
||||||
esac
|
|
||||||
|
|
||||||
_arguments \
|
|
||||||
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_git-changelog() {
|
|
||||||
_arguments \
|
|
||||||
'(-l --list)'{-l,--list}'[list commits]' \
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-chore() {
|
|
||||||
local curcontext=$curcontext state line ret=1
|
|
||||||
declare -A opt_args
|
|
||||||
|
|
||||||
_arguments -C \
|
|
||||||
': :->command' \
|
|
||||||
'*:: :->option-or-argument' && ret=0
|
|
||||||
|
|
||||||
case $state in
|
|
||||||
(command)
|
|
||||||
declare -a commands
|
|
||||||
commands=(
|
|
||||||
'finish:merge and delete the chore branch'
|
|
||||||
)
|
|
||||||
_describe -t commands command commands && ret=0
|
|
||||||
;;
|
|
||||||
(option-or-argument)
|
|
||||||
curcontext=${curcontext%:*}-$line[1]:
|
|
||||||
case $line[1] in
|
|
||||||
(finish)
|
|
||||||
_arguments -C \
|
|
||||||
':branch-name:__gitex_chore_branch_names'
|
|
||||||
;;
|
|
||||||
-r|--remote )
|
|
||||||
_arguments -C \
|
|
||||||
':remote-name:__gitex_remote_names'
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
return 0
|
|
||||||
esac
|
|
||||||
|
|
||||||
_arguments \
|
|
||||||
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-coauthor() {
|
|
||||||
_arguments \
|
|
||||||
':co-author[co-author to add]' \
|
|
||||||
':co-author-email[email address of co-author to add]'
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-contrib() {
|
|
||||||
_arguments \
|
|
||||||
':author:__gitex_author_names'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_git-count() {
|
|
||||||
_arguments \
|
|
||||||
'--all[detailed commit count]'
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-create-branch() {
|
|
||||||
local curcontext=$curcontext state line
|
|
||||||
_arguments -C \
|
|
||||||
': :->command' \
|
|
||||||
'*:: :->option-or-argument'
|
|
||||||
|
|
||||||
case "$state" in
|
|
||||||
(command)
|
|
||||||
_arguments \
|
|
||||||
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
|
|
||||||
;;
|
|
||||||
(option-or-argument)
|
|
||||||
curcontext=${curcontext%:*}-$line[1]:
|
|
||||||
case $line[1] in
|
|
||||||
-r|--remote )
|
|
||||||
_arguments -C \
|
|
||||||
':remote-name:__gitex_remote_names'
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-delete-branch() {
|
|
||||||
_arguments \
|
|
||||||
':branch-name:__gitex_branch_names'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_git-delete-submodule() {
|
|
||||||
_arguments \
|
|
||||||
':submodule-name:__gitex_submodule_names'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_git-delete-tag() {
|
|
||||||
_arguments \
|
|
||||||
':tag-name:__gitex_tag_names'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_git-effort() {
|
|
||||||
_arguments \
|
|
||||||
'--above[ignore file with less than x commits]'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_git-extras() {
|
|
||||||
local curcontext=$curcontext state line ret=1
|
|
||||||
declare -A opt_args
|
|
||||||
|
|
||||||
_arguments -C \
|
|
||||||
': :->command' \
|
|
||||||
'*:: :->option-or-argument' && ret=0
|
|
||||||
|
|
||||||
case $state in
|
|
||||||
(command)
|
|
||||||
declare -a commands
|
|
||||||
commands=(
|
|
||||||
'update:update git-extras'
|
|
||||||
)
|
|
||||||
_describe -t commands command commands && ret=0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
_arguments \
|
|
||||||
'(-v --version)'{-v,--version}'[show current version]'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_git-feature() {
|
|
||||||
local curcontext=$curcontext state line ret=1
|
|
||||||
declare -A opt_args
|
|
||||||
|
|
||||||
_arguments -C \
|
|
||||||
': :->command' \
|
|
||||||
'*:: :->option-or-argument' && ret=0
|
|
||||||
|
|
||||||
case $state in
|
|
||||||
(command)
|
|
||||||
declare -a commands
|
|
||||||
commands=(
|
|
||||||
'finish:merge feature into the current branch'
|
|
||||||
)
|
|
||||||
_describe -t commands command commands && ret=0
|
|
||||||
;;
|
|
||||||
(option-or-argument)
|
|
||||||
curcontext=${curcontext%:*}-$line[1]:
|
|
||||||
case $line[1] in
|
|
||||||
(finish)
|
|
||||||
_arguments -C \
|
|
||||||
':branch-name:__gitex_feature_branch_names'
|
|
||||||
;;
|
|
||||||
-r|--remote )
|
|
||||||
_arguments -C \
|
|
||||||
':remote-name:__gitex_remote_names'
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
return 0
|
|
||||||
esac
|
|
||||||
|
|
||||||
_arguments \
|
|
||||||
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-graft() {
|
|
||||||
_arguments \
|
|
||||||
':src-branch-name:__gitex_branch_names' \
|
|
||||||
':dest-branch-name:__gitex_branch_names'
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-guilt() {
|
|
||||||
_arguments -C \
|
|
||||||
'(--email -e)'{--email,-e}'[display author emails instead of names]' \
|
|
||||||
'(--ignore-whitespace -w)'{--ignore-whitespace,-w}'[ignore whitespace only changes]' \
|
|
||||||
'(--debug -d)'{--debug,-d}'[output debug information]' \
|
|
||||||
'-h[output usage information]'
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-ignore() {
|
|
||||||
_arguments -C \
|
|
||||||
'(--local -l)'{--local,-l}'[show local gitignore]' \
|
|
||||||
'(--global -g)'{--global,-g}'[show global gitignore]' \
|
|
||||||
'(--private -p)'{--private,-p}'[show repo gitignore]'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_git-ignore() {
|
|
||||||
_arguments -C \
|
|
||||||
'(--append -a)'{--append,-a}'[append .gitignore]' \
|
|
||||||
'(--replace -r)'{--replace,-r}'[replace .gitignore]' \
|
|
||||||
'(--list-in-table -l)'{--list-in-table,-l}'[print available types in table format]' \
|
|
||||||
'(--list-alphabetically -L)'{--list-alphabetically,-L}'[print available types in alphabetical order]' \
|
|
||||||
'(--search -s)'{--search,-s}'[search word in available types]'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_git-merge-into() {
|
|
||||||
_arguments '--ff-only[merge only fast-forward]'
|
|
||||||
_arguments \
|
|
||||||
':src:__gitex_branch_names' \
|
|
||||||
':dest:__gitex_branch_names'
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-missing() {
|
|
||||||
_arguments \
|
|
||||||
':first-branch-name:__gitex_branch_names' \
|
|
||||||
':second-branch-name:__gitex_branch_names'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_git-refactor() {
|
|
||||||
local curcontext=$curcontext state line ret=1
|
|
||||||
declare -A opt_args
|
|
||||||
|
|
||||||
_arguments -C \
|
|
||||||
': :->command' \
|
|
||||||
'*:: :->option-or-argument' && ret=0
|
|
||||||
|
|
||||||
case $state in
|
|
||||||
(command)
|
|
||||||
declare -a commands
|
|
||||||
commands=(
|
|
||||||
'finish:merge refactor into the current branch'
|
|
||||||
)
|
|
||||||
_describe -t commands command commands && ret=0
|
|
||||||
;;
|
|
||||||
(option-or-argument)
|
|
||||||
curcontext=${curcontext%:*}-$line[1]:
|
|
||||||
case $line[1] in
|
|
||||||
(finish)
|
|
||||||
_arguments -C \
|
|
||||||
':branch-name:__gitex_refactor_branch_names'
|
|
||||||
;;
|
|
||||||
-r|--remote )
|
|
||||||
_arguments -C \
|
|
||||||
':remote-name:__gitex_remote_names'
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
return 0
|
|
||||||
esac
|
|
||||||
|
|
||||||
_arguments \
|
|
||||||
'(--remote -r)'{--remote,-r}'[setup remote tracking branch]'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_git-squash() {
|
|
||||||
_arguments '--squash-msg[commit with the squashed commit messages]'
|
|
||||||
_arguments \
|
|
||||||
':branch-name:__gitex_branch_names'
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-stamp() {
|
|
||||||
_arguments -C \
|
|
||||||
'(--replace -r)'{--replace,-r}'[replace stamps with same id]'
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-standup() {
|
|
||||||
_arguments -C \
|
|
||||||
'-a[Specify the author of commits. Use "all" to specify all authors.]' \
|
|
||||||
'-d[Show history since N days ago]' \
|
|
||||||
'-D[Specify the date format displayed in commit history]' \
|
|
||||||
'-f[Fetch commits before showing history]' \
|
|
||||||
'-g[Display GPG signed info]' \
|
|
||||||
'-h[Display help message]' \
|
|
||||||
'-L[Enable the inclusion of symbolic links]' \
|
|
||||||
'-m[The depth of recursive directory search]' \
|
|
||||||
'-B[Display the commits in branch groups]'
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-summary() {
|
|
||||||
_arguments '--line[summarize with lines rather than commits]'
|
|
||||||
_arguments '--dedup-by-email[remove duplicate users by the email address]'
|
|
||||||
__gitex_commits
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_git-undo(){
|
|
||||||
_arguments -C \
|
|
||||||
'(--soft -s)'{--soft,-s}'[only rolls back the commit but changes remain un-staged]' \
|
|
||||||
'(--hard -h)'{--hard,-h}'[wipes your commit(s)]'
|
|
||||||
}
|
|
||||||
|
|
||||||
zstyle -g existing_user_commands ':completion:*:*:git:*' user-commands
|
|
||||||
|
|
||||||
zstyle ':completion:*:*:git:*' user-commands $existing_user_commands \
|
|
||||||
alias:'define, search and show aliases' \
|
|
||||||
archive-file:'export the current head of the git repository to an archive' \
|
|
||||||
authors:'generate authors report' \
|
|
||||||
back:'undo and stage latest commits' \
|
|
||||||
bug:'create bug branch' \
|
|
||||||
bulk:'run bulk commands' \
|
|
||||||
changelog:'generate a changelog report' \
|
|
||||||
chore:'create chore branch' \
|
|
||||||
clear-soft:'soft clean up a repository' \
|
|
||||||
clear:'rigorously clean up a repository' \
|
|
||||||
coauthor: 'add a co-author to the last commit' \
|
|
||||||
commits-since:'show commit logs since some date' \
|
|
||||||
contrib:'show user contributions' \
|
|
||||||
count:'show commit count' \
|
|
||||||
create-branch:'create branches' \
|
|
||||||
delete-branch:'delete branches' \
|
|
||||||
delete-merged-branches:'delete merged branches' \
|
|
||||||
delete-submodule:'delete submodules' \
|
|
||||||
delete-tag:'delete tags' \
|
|
||||||
delta:'lists changed files' \
|
|
||||||
effort:'show effort statistics on file(s)' \
|
|
||||||
extras:'awesome git utilities' \
|
|
||||||
feature:'create/merge feature branch' \
|
|
||||||
force-clone:'overwrite local repositories with clone' \
|
|
||||||
fork:'fork a repo on github' \
|
|
||||||
fresh-branch:'create fresh branches' \
|
|
||||||
gh-pages:'create the github pages branch' \
|
|
||||||
graft:'merge and destroy a given branch' \
|
|
||||||
guilt:'calculate change between two revisions' \
|
|
||||||
ignore-io:'get sample gitignore file' \
|
|
||||||
ignore:'add .gitignore patterns' \
|
|
||||||
info:'returns information on current repository' \
|
|
||||||
local-commits:'list local commits' \
|
|
||||||
lock:'lock a file excluded from version control' \
|
|
||||||
locked:'ls files that have been locked' \
|
|
||||||
merge-into:'merge one branch into another' \
|
|
||||||
merge-repo:'merge two repo histories' \
|
|
||||||
missing:'show commits missing from another branch' \
|
|
||||||
mr:'checks out a merge request locally' \
|
|
||||||
obliterate:'rewrite past commits to remove some files' \
|
|
||||||
paste:'send patches to pastebin sites' \
|
|
||||||
pr:'checks out a pull request locally' \
|
|
||||||
psykorebase:'rebase a branch with a merge commit' \
|
|
||||||
pull-request:'create pull request to GitHub project' \
|
|
||||||
reauthor:'replace the author and/or committer identities in commits and tags' \
|
|
||||||
rebase-patch:'rebases a patch' \
|
|
||||||
refactor:'create refactor branch' \
|
|
||||||
release:'commit, tag and push changes to the repository' \
|
|
||||||
rename-branch:'rename a branch' \
|
|
||||||
rename-tag:'rename a tag' \
|
|
||||||
rename-remote:'rename a remote' \
|
|
||||||
repl:'git read-eval-print-loop' \
|
|
||||||
reset-file:'reset one file' \
|
|
||||||
root:'show path of root' \
|
|
||||||
scp:'copy files to ssh compatible `git-remote`' \
|
|
||||||
sed:'replace patterns in git-controlled files' \
|
|
||||||
setup:'set up a git repository' \
|
|
||||||
show-merged-branches:'show merged branches' \
|
|
||||||
show-tree:'show branch tree of commit history' \
|
|
||||||
show-unmerged-branches:'show unmerged branches' \
|
|
||||||
squash:'import changes from a branch' \
|
|
||||||
stamp:'stamp the last commit message' \
|
|
||||||
standup:'recall the commit history' \
|
|
||||||
summary:'show repository summary' \
|
|
||||||
sync:'sync local branch with remote branch' \
|
|
||||||
touch:'touch and add file to the index' \
|
|
||||||
undo:'remove latest commits' \
|
|
||||||
unlock:'unlock a file excluded from version control'
|
|
Loading…
Reference in New Issue