master
blob42 1 year ago
parent e841162fc8
commit 26a855646e

@ -58,10 +58,20 @@ M.general = { --{{{
["<leader>="] = { "<C-w>=", "adjust viewports " },
-- quit dont save
["<leader>qq"] = { "<cmd> quitall! <cr>", "quit/close all windows, don't save" },
["<leader>qq"] = {function()
local Job = require("plenary.job")
local msg = 'use ZQ or ZX for (!qa)'
Job:new({
command = 'dunstify',
args = {'-a', 'neovim', 'mapping changed', msg}
}):sync()
end, "quit/close all windows, don't save" },
["ZX"] = { ":qa!<CR>", "quit all no save" },
-- ["Q"] = { "<cmd> q!<cr>", "quit now" },
-- easier horizontal scrolling
["zl"] = { "zL", "horizontal scroll left" },
["zh"] = { "zH", "horizontal scroll right" },
@ -773,6 +783,12 @@ M.nvterm = { --{{{
end,
"toggle horizontal term",
},
["<A-v>"] = {
function()
require("nvterm.terminal").toggle "vertical"
end,
"toggle vertical term",
},
},
n = {
@ -892,7 +908,8 @@ M.asyncrun = { --{{{
-- ["``"] = { "<cmd> call asyncrun#quickfix_toggle(8)<CR>", "toggle quickfix window" },
-- HELP:
-- adding ! after AsyncRun disables autoscroll
["<leader>m"] = { ":AsyncRun -program=" .. vim.o.makeprg .. "<CR>", "make using quickfix asyncrun" },
-- -raw disables matchint errorformat, remove raw to enable it again
["<leader>m"] = { ":AsyncRun -raw -program=" .. vim.o.makeprg .. "<CR>", "make using quickfix asyncrun" },
["<leader>mf"] = { function()
require('spike.utils.nvterm').run_cmd(vim.o.makeprg, { mode = "float"} )
end, "run make in a floating terminal" },
@ -1108,10 +1125,16 @@ M.null_ls = {
plugin = true,
n = {
["<leader>nlr"] = {function()
require('null-ls').toggle({
name = 'revive'
})
local null_ls = require('null-ls')
if not null_ls.is_registered({ name = 'revive'}) then
null_ls.register(null_ls.builtins.diagnostics.revive)
else
null_ls.toggle({ name = 'revive' })
end
end, "null-ls toggle golang linter <revive>"},
['<leader>nls'] = { function()
require('spike.nullls').select_sources()
end, 'desc' },
}
}

@ -175,7 +175,7 @@ M.packer_sync = function(...)
end
M.bufilter = function()
local bufs = vim.t.bufs
local bufs = vim.t.bufs or {}
for i = #bufs, 1, -1 do
if not vim.api.nvim_buf_is_valid(bufs[i]) then

@ -37,10 +37,14 @@ config = {
max_width = { 140, 0.9 },
min_width = { 20, 0.2 },
-- Window transparency (0-100)
winblend = 10,
-- Change default highlight groups (see :help winhl)
winhighlight = "",
win_options = {
-- Window transparency (0-100)
winblend = 10,
-- Change default highlight groups (see :help winhl)
winhighlight = "",
},
-- Set to `false` to disable
mappings = {
@ -70,7 +74,7 @@ config = {
enabled = true,
-- Priority list of preferred vim.select implementations
backend = { "fzf_lua", "telescope", "fzf", "builtin", "nui" },
backend = { "telescope", "fzf_lua", "nui", "builtin", "fzf" },
-- Trim trailing `:` from prompt
trim_prompt = true,
@ -78,8 +82,13 @@ config = {
-- Options for telescope selector
-- These are passed into the telescope picker directly. Can be used like:
-- telescope = require('telescope.themes').get_ivy({...})
telescope = nil,
telescope = {
layout_config = {
width = 0.6,
height = 0.6,
},
},
-- Options for fzf selector
fzf = {
window = {
@ -125,10 +134,13 @@ config = {
-- 'editor' and 'win' will default to being centered
relative = "editor",
-- Window transparency (0-100)
winblend = 10,
-- Change default highlight groups (see :help winhl)
winhighlight = "",
win_options = {
-- Window transparency (0-100)
winblend = 10,
-- Change default highlight groups (see :help winhl)
winhighlight = "",
},
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- the min_ and max_ options can be a list of mixed types.
@ -148,6 +160,7 @@ config = {
},
override = function(conf)
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
return conf

@ -19,6 +19,9 @@ local config = {
-- dap_debug_gui = false,
-- dap_debug_vt = false,
log_path = vim.fn.stdpath('cache') .. '/gonvim.log',
lsp_inlay_hints = {
enable = true,
}
}
function M.setup()

@ -14,12 +14,12 @@ local options = {
ext_opts = {
[types.choiceNode] = {
passive = {
virt_text = { { " ", "LuaSnipChoice" } },
virt_text = { { " ", "LuaSnipChoice" } },
}
},
[types.insertNode] = {
passive = {
virt_text = { { " ", "LuaSnipInsert" } },
virt_text = { { " ", "LuaSnipInsert" } },
}
}
},

@ -171,6 +171,19 @@ local config = {
}
}
},
pylsp = {
settings = {
pylsp = {
plugins = {
autopep8 = { enabled = false },
-- pylint = { enabled = false },
flake8 = { enabled = false },
pycodestyle= { enabled = false},
pyflakes = { enabled = false },
}
}
}
},
sumneko_lua = {
before_init=require("neodev.lsp").before_init,
}

@ -11,10 +11,22 @@ M.config = {
default_timeout = 5000,
sources = {
null_ls.builtins.code_actions.gitsigns,
-- null_ls.builtins.diagnostics.golangci_lint,
null_ls.builtins.code_actions.refactoring,
null_ls.builtins.code_actions.shellcheck,
-- golang revive
null_ls.builtins.diagnostics.revive,
null_ls.builtins.diagnostics.checkmake,
null_ls.builtins.diagnostics.fish,
null_ls.builtins.diagnostics.hadolint,
null_ls.builtins.diagnostics.jshint,
null_ls.builtins.diagnostics.flake8,
-- null_ls.builtins.diagnostics.pylint,
null_ls.builtins.formatting.autoflake,
null_ls.builtins.formatting.autopep8,
-- golang revive (manually enabled with shortcut from mappings)
-- null_ls.builtins.diagnostics.revive,
},
on_attach = function(client, bufnr)
local util = require('navigator.util')

@ -568,8 +568,9 @@ return {
end,
},
["ray-x/guihua.lua"] = {
lock = true,
-- lock = true,
module = { "navigator" },
module_pattern = {"guihua*"},
run = "cd lua/fzy && make",
config = function()
require("guihua.maps").setup {

@ -1,6 +1,7 @@
local present, telescope = pcall(require, "telescope")
if not present then
vim.notify("missing module telescope", vim.log.levels.WARN)
return
end
@ -54,7 +55,8 @@ local options = {
-- Developer configurations: Not meant for general override
buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker,
mappings = {
n = { ["q"] = require("telescope.actions").close },
n = { ["q"] = require("telescope.actions").close
},
},
},
@ -65,6 +67,7 @@ local options = {
options = require("core.utils").load_override(options, "nvim-telescope/telescope.nvim")
telescope.setup(options)
-- load extensions
pcall(function()
for _, ext in ipairs(options.extensions_list) do

@ -186,6 +186,7 @@ local plugins = {
["nvim-telescope/telescope.nvim"] = {
cmd = "Telescope",
module = {"telescope"},
config = function()
require "plugins.configs.telescope"
end,

@ -0,0 +1,30 @@
local ok, null_ls = pcall(require, 'null-ls')
if not ok then
vim.notify("missing module null-ls", vim.log.levels.WARN)
return
end
_ = require('dressing')
local M = {}
M.select_sources = function()
local sources = null_ls.get_sources()
--TODO: add entry to disable / activate all aka disable null-ls
vim.ui.select(sources, {
prompt = "select source to toggle:",
format_item = function (item)
local enabled = item._disabled
local entry = item._disabled and '' or ''
return entry .. ' ' .. item.name
end,
}, function(item)
if item then null_ls.toggle({name = item.name }) end
end)
end
return M

@ -37,6 +37,19 @@ return M
),
-- add a custom mapping
s({ trig = 'map', dscr = 'add custom mapping'}, fmt([[
['{}'] = {{ {}, '{}' }},
]], {
i(1, 'from'),
c(3, {
sn(nil, fmt([['{}']], {i(1)})),
sn(nil, fmt([[function() {} end]], {i(1)})),
}),
i(2, "desc")
})),
-- add packer plugin
s({ trig = "plug", dscr = "add packer plugin"}, fmt([[
["{}"] = {{

Loading…
Cancel
Save