Arroz para nvim 0.7 y otra prueba de lazyloading a ver que onda. Los themes de telescope son imposibles, o yo no entendi una goma... en fin. Tambien hay 2 cambios minimos de ortografia
This commit is contained in:
parent
ed86224280
commit
8ab144db22
|
@ -42,7 +42,7 @@ bspc config presel_feedback_color "$(get_xrdb color6)"
|
|||
bspc rule -a mpv state=floating
|
||||
bspc rule -a pentablet state=floating
|
||||
bspc rule -a Alacritty:flota state=floating
|
||||
bspc rule -a firefox:Browser state=floating
|
||||
bspc rule -a Firefox:Browser state=floating
|
||||
bspc rule -a Firefox:Navigator state=tiled desktop='^6'
|
||||
bspc rule -a Zathura state=tiled
|
||||
bspc rule -a Borderlands2 state=fullscreen
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
full = show --format=fuller
|
||||
noed = commit --amend --no-edit
|
||||
tr = log --graph --date-order --date=short --pretty=format:'%C(cyan)%h %C(blue)%ar%C(auto)%d %C(yellow)%s%+b %C(black)%ae'
|
||||
fz = !sha=$( git -c color.ui=always log --oneline -n 1000 | fzf +s --no-multi --prompt 'Fixup> ' ) && git commit --fixup "${sha%% *}"
|
||||
fr = !sha=$( git -c color.ui=always log --oneline -n 1000 | fzf +s --no-multi --prompt 'Revert> ' ) && git revert "${sha%% *}"
|
||||
fz = !sha=$( git -c color.ui=auto log --oneline -n 1000 | fzf +s --no-multi --prompt 'Fixup> ' ) && git commit --fixup "${sha%% *}"
|
||||
fr = !sha=$( git -c color.ui=auto log --oneline -n 1000 | fzf +s --no-multi --prompt 'Revert> ' ) && git revert "${sha%% *}"
|
||||
wd = "!f() { git --paginate diff --dirstat=cumulative,files,0 ${1:-HEAD} | awk '{print $2}' | cut -d / -f1-${2:-4} | sort | uniq; }; f"
|
||||
|
||||
[http]
|
||||
|
@ -39,7 +39,7 @@
|
|||
[delta]
|
||||
side-by-side = false
|
||||
line-numbers = true
|
||||
syntax-theme = gruvbox
|
||||
syntax-theme = gruvbox-dark
|
||||
hunk-header-style = omit
|
||||
file-style = blue
|
||||
file-decoration-style = blue ul ol
|
||||
|
@ -90,7 +90,7 @@
|
|||
diff = auto
|
||||
status = auto
|
||||
branch = auto
|
||||
ui = true
|
||||
ui = auto
|
||||
|
||||
[rerere]
|
||||
enabled = true
|
||||
|
@ -99,7 +99,6 @@
|
|||
lineNumber = true
|
||||
extendRegexp = true
|
||||
|
||||
|
||||
[gpg]
|
||||
program = gpg2
|
||||
|
||||
|
|
10
lf/lfrc
10
lf/lfrc
|
@ -190,13 +190,6 @@ cmd yes_preview :{{
|
|||
map ~ no_preview
|
||||
}}
|
||||
|
||||
cmd newfold ${{
|
||||
set -f
|
||||
read newd
|
||||
mkdir -- "$newd"
|
||||
mv -- $fx "$newd"
|
||||
}}
|
||||
|
||||
cmd yank-dirname $dirname -- "$f" | head -c-1 | xclip -i -selection clipboard
|
||||
cmd yank-path $printf '%s' "$fx" | xclip -i -selection clipboard
|
||||
cmd yank-basename $basename -a -- $fx | head -c-1 | xclip -i -selection clipboard
|
||||
|
@ -274,8 +267,7 @@ map Y %cp -ri $fs .
|
|||
map D %mv -i $fs .
|
||||
map zf $file-roller "$f"
|
||||
map zc $zip -9 -r "$f".cbz $f
|
||||
map zx $zu "$f"
|
||||
map zn newfold
|
||||
map zx $zx "$f"
|
||||
map I push A<c-a> # at the very beginning
|
||||
map A rename # at the very end
|
||||
map i push A<a-b><c-b> # at the very beginning
|
||||
|
|
102
nvim/init.lua
102
nvim/init.lua
|
@ -15,7 +15,7 @@ end
|
|||
|
||||
packer.init({
|
||||
enable = true,
|
||||
threshold= 0,
|
||||
threshold = 0,
|
||||
display = {
|
||||
open_fn = function()
|
||||
return require("packer.util").float({ border = "single" })
|
||||
|
@ -25,36 +25,40 @@ packer.init({
|
|||
|
||||
return packer.startup({
|
||||
function(use)
|
||||
use({ "wbthomason/packer.nvim" })
|
||||
use("nvim-lua/plenary.nvim")
|
||||
use({
|
||||
"lewis6991/impatient.nvim",
|
||||
config = function()
|
||||
require("impatient")
|
||||
require("impatient").enable_profile()
|
||||
end,
|
||||
})
|
||||
use({ "wbthomason/packer.nvim" })
|
||||
use({ "nathom/filetype.nvim" })
|
||||
use("nvim-lua/plenary.nvim")
|
||||
use({ "ellisonleao/gruvbox.nvim" })
|
||||
use({ "kyazdani42/nvim-web-devicons",
|
||||
use({ "kyazdani42/nvim-web-devicons" })
|
||||
use({
|
||||
"nvim-telescope/telescope.nvim",
|
||||
config = function()
|
||||
require("plugins.icons")
|
||||
require("plugins.telescope")
|
||||
end,
|
||||
})
|
||||
use({ "nvim-telescope/telescope-file-browser.nvim" })
|
||||
use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" })
|
||||
use({
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("plugins.colorizer")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufRead", "BufNewFile" },
|
||||
run = ":TSUpdate",
|
||||
config = function()
|
||||
require("plugins.treesitter")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
event = "BufReadPre",
|
||||
config = function()
|
||||
require("plugins.colorizer")
|
||||
end,
|
||||
})
|
||||
use({ "tpope/vim-fugitive", opt = true, cmd = { "Git", "Gdiff", "Gblame", "Glog", "Git mergetool" } })
|
||||
use({
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = "BufReadPre",
|
||||
|
@ -62,65 +66,57 @@ return packer.startup({
|
|||
require("plugins.gitsigns_nvim")
|
||||
end,
|
||||
})
|
||||
use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" })
|
||||
use({ "nvim-telescope/telescope-file-browser.nvim" })
|
||||
use({
|
||||
"nvim-telescope/telescope.nvim",
|
||||
config = function()
|
||||
require("plugins.telescope")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"numToStr/Comment.nvim",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("Comment").setup()
|
||||
end,
|
||||
})
|
||||
use({ "tpope/vim-fugitive", opt = true, cmd = { "Git", "Gdiff", "Gblame", "Glog", "Git mergetool" } })
|
||||
use({
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require("plugins.lsp.lsp-config")
|
||||
end,
|
||||
requires = { "ray-x/lsp_signature.nvim", "hrsh7th/cmp-nvim-lsp" },
|
||||
})
|
||||
use({ "ray-x/lsp_signature.nvim", after = "nvim-lspconfig" })
|
||||
use({
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
after = "nvim-lspconfig",
|
||||
config = function()
|
||||
require("plugins.lsp.null-ls")
|
||||
end,
|
||||
})
|
||||
use({ "rafamadriz/friendly-snippets", module = "cmp_nvim_lsp", event = "InsertEnter" })
|
||||
use({
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
config = function()
|
||||
require("plugins.lsp.nvim-cmp")
|
||||
end,
|
||||
requires = {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
config = function()
|
||||
require("plugins.lsp.luasnip")
|
||||
end,
|
||||
requires = { "rafamadriz/friendly-snippets" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{ "hrsh7th/cmp-path", after = "nvim-cmp" },
|
||||
{ "hrsh7th/cmp-buffer", after = "nvim-cmp" },
|
||||
{ "f3fora/cmp-spell", after = "nvim-cmp" },
|
||||
{ "hrsh7th/cmp-nvim-lua", after = "nvim-cmp" },
|
||||
{ "saadparwaiz1/cmp_luasnip", after = "LuaSnip"},
|
||||
{ "hrsh7th/cmp-nvim-lsp-signature-help", after = "lsp_signature.nvim" },
|
||||
"hrsh7th/nvim-cmp",
|
||||
after = "friendly-snippets",
|
||||
config = function()
|
||||
require("plugins.lsp.nvim-cmp")
|
||||
end,
|
||||
})
|
||||
use({ "f3fora/cmp-spell", after = "nvim-cmp" })
|
||||
use({
|
||||
"L3MON4D3/LuaSnip",
|
||||
wants = "friendly-snippets",
|
||||
after = "nvim-cmp",
|
||||
config = function()
|
||||
require("plugins.lsp.luasnip")
|
||||
end,
|
||||
})
|
||||
use({ "saadparwaiz1/cmp_luasnip", after = "LuaSnip" })
|
||||
use({ "hrsh7th/cmp-nvim-lua", after = "cmp_luasnip" })
|
||||
use({ "hrsh7th/cmp-nvim-lsp", after = "cmp-nvim-lua" })
|
||||
use({ "hrsh7th/cmp-buffer", after = "cmp-nvim-lsp" })
|
||||
use({ "hrsh7th/cmp-path", after = "cmp-buffer" })
|
||||
use({ "hrsh7th/cmp-nvim-lsp-signature-help", after = "cmp-path" })
|
||||
use({
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertCharPre",
|
||||
after = "nvim-cmp",
|
||||
config = function()
|
||||
require("plugins.autopairs")
|
||||
end,
|
||||
})
|
||||
use({
|
||||
"numToStr/Comment.nvim",
|
||||
module = "Comment",
|
||||
keys = { "gc", "gb" },
|
||||
config = function()
|
||||
require("Comment").setup()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -2,13 +2,13 @@ require("gitsigns").setup({
|
|||
signcolumn = true,
|
||||
current_line_blame_opts = { delay = 2000, virt_text_pos = "right_align" },
|
||||
signs = {
|
||||
add = { hl = "GitSignsAdd", text = "┃", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
|
||||
change = { hl = "GitSignsChange", text = "┃", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
delete = { hl = "GitSignsDelete", text = "╏", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
topdelete = { hl = "GitSignsDelete", text = "┯", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
add = { hl = "GitSignsAdd", text = "│", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
|
||||
change = { hl = "GitSignsChange", text = "│", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
delete = { hl = "GitSignsDelete", text = "┆", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
topdelete = { hl = "GitSignsDelete", text = "┬", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
changedelete = {
|
||||
hl = "GitSignsChange",
|
||||
text = "╍",
|
||||
text = "┴",
|
||||
numhl = "GitSignsChangeNr",
|
||||
linehl = "GitSignsChangeLn",
|
||||
},
|
||||
|
|
|
@ -4,94 +4,102 @@ if not ok then
|
|||
return
|
||||
end
|
||||
|
||||
web_devicons.setup {
|
||||
web_devicons.setup({
|
||||
override = {
|
||||
default_icon = {
|
||||
icon = " ",
|
||||
name = "Default",
|
||||
},
|
||||
zsh = {
|
||||
icon = " ",
|
||||
name = "Zsh",
|
||||
},
|
||||
c = {
|
||||
icon = " ",
|
||||
name = "c",
|
||||
},
|
||||
html = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "html",
|
||||
},
|
||||
css = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "css",
|
||||
},
|
||||
scss = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "scss",
|
||||
},
|
||||
sass = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "sass",
|
||||
},
|
||||
js = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "js",
|
||||
},
|
||||
ts = {
|
||||
icon = "ﯤ",
|
||||
icon = " ",
|
||||
name = "ts",
|
||||
},
|
||||
kt = {
|
||||
icon = "",
|
||||
name = "kt",
|
||||
},
|
||||
png = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "png",
|
||||
},
|
||||
jpg = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "jpg",
|
||||
},
|
||||
jpeg = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "jpeg",
|
||||
},
|
||||
mp3 = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "mp3",
|
||||
},
|
||||
mp4 = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "mp4",
|
||||
},
|
||||
out = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "out",
|
||||
},
|
||||
rb = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "rb",
|
||||
},
|
||||
vue = {
|
||||
icon = "﵂",
|
||||
icon = "﵂ ",
|
||||
name = "vue",
|
||||
},
|
||||
py = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "py",
|
||||
},
|
||||
toml = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "toml",
|
||||
},
|
||||
lock = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "lock",
|
||||
},
|
||||
zip = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "zip",
|
||||
},
|
||||
xz = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "xz",
|
||||
},
|
||||
deb = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "deb",
|
||||
},
|
||||
rpm = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "rpm",
|
||||
},
|
||||
lua = {
|
||||
|
@ -99,111 +107,111 @@ web_devicons.setup {
|
|||
name = "lua",
|
||||
},
|
||||
txt = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "txt",
|
||||
},
|
||||
md = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "markdown",
|
||||
},
|
||||
graphql = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "graphql",
|
||||
},
|
||||
env = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "dotenvexample",
|
||||
},
|
||||
[".env.production"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "envprod",
|
||||
},
|
||||
[".env.development"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "envdev",
|
||||
},
|
||||
[".env.testing"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "envtest",
|
||||
},
|
||||
[".env.example"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "dotenvexample",
|
||||
},
|
||||
[".env"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "dotenv",
|
||||
},
|
||||
["docker-compose.yml"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "dockercompose",
|
||||
},
|
||||
[".dockerignore"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "dockerignore",
|
||||
},
|
||||
[".prettierignore"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "prettierignore",
|
||||
},
|
||||
[".prettierrc"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "prettier",
|
||||
},
|
||||
[".prettierrc.json"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "prettierjson",
|
||||
},
|
||||
[".prettierrc.js"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "prettierrcjs",
|
||||
},
|
||||
["prettier.config.js"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "prettierjsconfig",
|
||||
},
|
||||
[".prettier.yaml"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "prettieryaml",
|
||||
},
|
||||
["test.js"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "javascripttest",
|
||||
},
|
||||
["test.jsx"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "reactrest",
|
||||
},
|
||||
["test.ts"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "typescripttest",
|
||||
},
|
||||
["test.tsx"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "reacttypescripttest",
|
||||
},
|
||||
["spec.js"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "javascriptspectest",
|
||||
},
|
||||
["spec.jsx"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "reactspectest",
|
||||
},
|
||||
["spec.ts"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "typescriptspectest",
|
||||
},
|
||||
["spec.tsx"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "reacttypescriptspectest",
|
||||
},
|
||||
["yarn-error.log"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "yarnerrorlog",
|
||||
},
|
||||
["yarn.lock"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "yarnlock",
|
||||
},
|
||||
["package.json"] = {
|
||||
|
@ -211,37 +219,45 @@ web_devicons.setup {
|
|||
name = "npm_packagejson",
|
||||
},
|
||||
[".gitignore"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "gitignore",
|
||||
},
|
||||
[".gitattributes"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "gitattributes",
|
||||
},
|
||||
["Dockerfile"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "dockerfilex",
|
||||
},
|
||||
[".nvmrc"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "nvmrc",
|
||||
},
|
||||
[".eslintrc.js"] = {
|
||||
icon = "ﯶ",
|
||||
icon = "ﯶ ",
|
||||
name = "eslintrcjs",
|
||||
},
|
||||
[".travis.yml"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "travis",
|
||||
},
|
||||
["babel.config.js"] = {
|
||||
icon = "",
|
||||
icon = " ",
|
||||
name = "babelconfig",
|
||||
},
|
||||
[".commitlintrc.json"] = {
|
||||
icon = "ﰚ",
|
||||
icon = "ﰚ ",
|
||||
name = "commitlinrcjson",
|
||||
},
|
||||
woff = {
|
||||
icon = " ",
|
||||
name = "WebOpenFontFormat",
|
||||
},
|
||||
woff2 = {
|
||||
icon = " ",
|
||||
name = "WebOpenFontFormat2",
|
||||
},
|
||||
},
|
||||
default = true,
|
||||
}
|
||||
})
|
||||
|
|
|
@ -44,15 +44,12 @@ end
|
|||
|
||||
lsconf.sumneko_lua.setup({
|
||||
cmd = { sumneko_binary, "-E", sumneko_root_path .. "/main.lua" },
|
||||
flags = flags,
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
handlers = handlers,
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
enable = true,
|
||||
showWord = "Disable",
|
||||
keywordSnippet = "Replace",
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
|
@ -62,7 +59,13 @@ lsconf.sumneko_lua.setup({
|
|||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
|
||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||
},
|
||||
maxPreload = 100000,
|
||||
preloadFileSize = 10000,
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
|
@ -72,10 +75,6 @@ lsconf.sumneko_lua.setup({
|
|||
})
|
||||
|
||||
require("lspconfig/configs").ls_emmet = {
|
||||
flags = flags,
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
handlers = handlers,
|
||||
default_config = {
|
||||
cmd = { "ls_emmet", "--stdio" },
|
||||
filetypes = {
|
||||
|
@ -97,7 +96,7 @@ require("lspconfig/configs").ls_emmet = {
|
|||
},
|
||||
}
|
||||
|
||||
local servers = { "html", "cssls", "tailwindcss", "vimls", "jsonls" }
|
||||
local servers = { "sumneko_lua", "ls_emmet", "html", "cssls", "tailwindcss", "vimls", "jsonls" }
|
||||
for _, lsp in ipairs(servers) do
|
||||
lsconf[lsp].setup({
|
||||
on_attach = on_attach,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
local cmp_kinds = {
|
||||
Text = " ",
|
||||
Text = " ",
|
||||
Method = " ",
|
||||
Function = " ",
|
||||
Constructor = " ",
|
||||
|
@ -27,23 +27,21 @@ local cmp_kinds = {
|
|||
}
|
||||
|
||||
local has_words_before = function()
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
local luasnip = require("luasnip")
|
||||
local cmp = require("cmp")
|
||||
cmp.setup({
|
||||
enabled = function()
|
||||
-- disable completion in comments
|
||||
local context = require 'cmp.config.context'
|
||||
-- keep command mode completion enabled when cursor is in a comment
|
||||
if vim.api.nvim_get_mode().mode == 'c' then
|
||||
return true
|
||||
else
|
||||
return not context.in_treesitter_capture("comment")
|
||||
and not context.in_syntax_group("Comment")
|
||||
end
|
||||
end,
|
||||
enabled = function()
|
||||
-- disable completion in comments
|
||||
local context = require("cmp.config.context")
|
||||
-- keep command mode completion enabled when cursor is in a comment
|
||||
if vim.api.nvim_get_mode().mode == "c" then
|
||||
return true
|
||||
else
|
||||
return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment")
|
||||
end
|
||||
end,
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
|
@ -70,31 +68,32 @@ cmp.setup({
|
|||
select = true,
|
||||
}),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_locally_jumpable() then
|
||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif require("luasnip").expand_or_locally_jumpable() then
|
||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {"i", "s"}),
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif require("luasnip").jumpable(-1) then
|
||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "luasnip", max_item_count = 5 },
|
||||
{ name = "nvim_lsp", max_item_count = 5 },
|
||||
{ name = "path", max_item_count = 10 },
|
||||
{ name = "buffer", max_item_count = 10 },
|
||||
{ name = "nvim_lsp_signature_help" },
|
||||
{ name = "nvim_lsp", max_item_count = 20, priority_weight = 100 },
|
||||
{ name = "luasnip", priority_weight = 120 },
|
||||
{ name = "buffer", max_item_count = 5, priority_weight = 80 },
|
||||
{ name = "path", max_item_count = 10, priority_weight = 100 },
|
||||
{ name = "nvim_lsp_signature_help" },
|
||||
}),
|
||||
view = { entries = "native" },
|
||||
})
|
||||
|
|
|
@ -3,7 +3,7 @@ local previewers = require("telescope.previewers")
|
|||
local builtin = require("telescope.builtin")
|
||||
|
||||
require("telescope").setup({
|
||||
defaults = require("telescope.themes").get_ivy({
|
||||
defaults = {
|
||||
dynamic_preview_title = true,
|
||||
vimgrep_arguments = {
|
||||
"rg",
|
||||
|
@ -19,28 +19,11 @@ require("telescope").setup({
|
|||
filesize_limit = 5,
|
||||
timeout = 150,
|
||||
treesitter = true,
|
||||
title = false,
|
||||
},
|
||||
borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
|
||||
sorting_strategy = "ascending",
|
||||
layout_config = {
|
||||
prompt_position = "top",
|
||||
},
|
||||
pickers = {
|
||||
buffers = {
|
||||
mappings = {
|
||||
n = {
|
||||
["d"] = actions.delete_buffer,
|
||||
},
|
||||
},
|
||||
sort_mru = true,
|
||||
sort_lastused = true,
|
||||
},
|
||||
find_files = {
|
||||
find_command = { "fd", "--type", "f", "-c always", "-H", "--strip-cwd-prefix" },
|
||||
hidden = true,
|
||||
},
|
||||
},
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " → ",
|
||||
entry_prefix = " ",
|
||||
|
@ -53,16 +36,58 @@ require("telescope").setup({
|
|||
["<CR>"] = actions.select_default + actions.center,
|
||||
["<esc>"] = actions.close,
|
||||
["<TAB>"] = actions.toggle_selection + actions.move_selection_next,
|
||||
["<A-p>"] = require("telescope.actions.layout").toggle_preview,
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
file_browser = {
|
||||
hidden = true,
|
||||
theme = "ivy",
|
||||
},
|
||||
pickers = {
|
||||
buffers = {
|
||||
theme = "dropdown",
|
||||
results_height = 20,
|
||||
initial_mode = "normal",
|
||||
borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
|
||||
previewer = false,
|
||||
disable_devicons = true,
|
||||
mappings = {
|
||||
n = {
|
||||
["d"] = actions.delete_buffer,
|
||||
},
|
||||
},
|
||||
sort_mru = true,
|
||||
sort_lastused = true,
|
||||
ignore_current_buffer = true,
|
||||
},
|
||||
}),
|
||||
find_files = {
|
||||
find_command = { "fd", "--type", "f", "-c always", "-H", "--strip-cwd-prefix" },
|
||||
hidden = true,
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
file_browser = {
|
||||
hidden = true,
|
||||
hijack_netrw = true,
|
||||
theme = "ivy",
|
||||
borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
|
||||
grouped = true,
|
||||
initial_mode = "normal",
|
||||
sorting_strategy = "ascending",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local delta_bcommits = previewers.new_termopen_previewer({
|
||||
get_command = function(entry)
|
||||
return {
|
||||
"git",
|
||||
"-c",
|
||||
"core.pager=delta",
|
||||
"-c",
|
||||
"delta.side-by-side=false",
|
||||
"diff",
|
||||
entry.value .. "^!",
|
||||
"--",
|
||||
entry.current_file,
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
local delta = previewers.new_termopen_previewer({
|
||||
|
@ -84,7 +109,7 @@ end
|
|||
Delta_git_bcommits = function(opts)
|
||||
opts = opts or {}
|
||||
opts.previewer = {
|
||||
delta,
|
||||
delta_bcommits,
|
||||
previewers.git_commit_message.new(opts),
|
||||
previewers.git_commit_diff_as_was.new(opts),
|
||||
}
|
||||
|
@ -93,9 +118,9 @@ end
|
|||
|
||||
Project_files = function()
|
||||
local opts = { show_untracked = false } -- define here if you want to define something
|
||||
local ok = pcall(require("telescope.builtin").git_files, opts)
|
||||
local ok = pcall(builtin.git_files, opts)
|
||||
if not ok then
|
||||
require("telescope.builtin").find_files(opts)
|
||||
builtin.find_files(opts)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -105,13 +130,13 @@ vim.api.nvim_set_keymap("n", "<F2>", "<cmd>lua Project_files()<CR>", default_opt
|
|||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<F3>",
|
||||
":lua require'telescope'.extensions.file_browser.file_browser({path = vim.fn.expand('%:p:h')})<CR>",
|
||||
"<cmd>lua require'telescope'.extensions.file_browser.file_browser({path = vim.fn.expand('%:p:h')})<CR>",
|
||||
default_opts
|
||||
)
|
||||
vim.api.nvim_set_keymap("n", "<F4>", "<cmd>Telescope buffers<CR>", default_opts)
|
||||
vim.api.nvim_set_keymap("n", "<F5>", "<cmd>lua Delta_git_commits()<CR>", default_opts)
|
||||
vim.api.nvim_set_keymap("n", "<F6>", "<cmd>lua Delta_git_bcommits()<CR>", default_opts)
|
||||
vim.api.nvim_set_keymap("n", "<M-f>", "<cmd>Telescope live_grep<CR>", default_opts)
|
||||
vim.api.nvim_set_keymap("n", "<M-g>", "<cmd>Telescope git_commits<CR>", default_opts)
|
||||
vim.api.nvim_set_keymap("n", "<M-S-r>", "<cmd>Telescope resume<CR>", default_opts)
|
||||
|
||||
require("telescope").load_extension("fzf")
|
||||
require("telescope").load_extension("file_browser")
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
colorscheme gruvbox
|
||||
hi! Normal ctermbg=NONE guibg=NONE
|
||||
hi! NonText ctermbg=NONE guibg=NONE guifg=NONE ctermfg=NONE
|
||||
hi! SignColumn ctermbg=NONE guibg=NONE guifg=NONE ctermfg=NONE
|
||||
" hi! SignColumn ctermbg=NONE guibg=NONE guifg=NONE ctermfg=NONE
|
||||
hi! LspDiagnosticsLineNrError guibg=#51202A guifg=#FF0000 gui=bold
|
||||
hi! LspDiagnosticsLineNrWarning guibg=#51412A guifg=#FFA500 gui=bold
|
||||
hi! LspDiagnosticsLineNrInformation guibg=#1E535D guifg=#00FFFF gui=bold
|
||||
hi! LspDiagnosticsLineNrHint guibg=#1E205D guifg=#008bbd gui=bold
|
||||
hi! TelescopeNormal guibg=#000000
|
||||
highlight default link TelescopePromptPrefix TelescopeNormal
|
||||
highlight default link TelescopePromptCounter TelescopeNormal
|
||||
hi! default link TelescopePromptPrefix TelescopeNormal
|
||||
hi! default link TelescopePromptCounter TelescopeNormal
|
||||
|
||||
" gray
|
||||
highlight! CmpItemAbbrDeprecated guibg=NONE gui=strikethrough guifg=#808080
|
||||
|
|
|
@ -13,6 +13,10 @@ local disabled_builtin_plugins = {
|
|||
"logipat",
|
||||
"rrhelper",
|
||||
"matchit",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
}
|
||||
|
||||
for _, plugin in pairs(disabled_builtin_plugins) do
|
||||
|
|
|
@ -55,8 +55,8 @@ nnoremap N nzzzv
|
|||
nnoremap J mzJ`z
|
||||
|
||||
" Shift lines up and down
|
||||
nnoremap <silent> <leader>j :m .+1<cr>==
|
||||
nnoremap <silent> <leader>k :m .-2<cr>==
|
||||
nnoremap <silent> <C-j> :m .+1<cr>==
|
||||
nnoremap <silent> <C-k> :m .-2<cr>==
|
||||
|
||||
" j = gj :: k = gk while preserving numbered jumps ie. 12j or 30k
|
||||
nnoremap <buffer><silent><expr>j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj'
|
||||
|
|
|
@ -38,11 +38,12 @@ set wildignore+=**/coverage/*
|
|||
set wildignore+=**/node_modules/*
|
||||
set wildignore+=**/.git/*
|
||||
|
||||
let g:netrw_browse_split = 0
|
||||
let g:netrw_banner = 0
|
||||
let g:netrw_keepdir = 0
|
||||
let g:netrw_winsize = 25
|
||||
let g:netrw_liststyle = 3
|
||||
let g:netrw_localrmdir='rm -r'
|
||||
let g:netrw_localcopydircmd = 'cp -r'
|
||||
nnoremap <silent><F5> :Vex!<cr>
|
||||
" Superceded by telescope file browser plugin
|
||||
" let g:netrw_browse_split = 0
|
||||
" let g:netrw_banner = 0
|
||||
" let g:netrw_keepdir = 0
|
||||
" let g:netrw_winsize = 25
|
||||
" let g:netrw_liststyle = 3
|
||||
" let g:netrw_localrmdir='rm -r'
|
||||
" let g:netrw_localcopydircmd = 'cp -r'
|
||||
" nnoremap <silent><F5> :Vex!<cr>
|
||||
|
|
|
@ -6,6 +6,7 @@ alias \
|
|||
z='zathura' \
|
||||
g='git' \
|
||||
vv='nvi' \
|
||||
bc='bc -iq' \
|
||||
se='doas nvim' \
|
||||
am='alsamixer' \
|
||||
pm='pulsemixer' \
|
||||
|
|
Loading…
Reference in New Issue