lua dev tools and repl + folding options

navigator
spike 2 years ago
parent 9848ceff61
commit a6793205eb

@ -1,2 +1,6 @@
- [navigator] fix 'gi' keymap overriden by
[x] [navigator] fix 'gi' keymap overriden by navigator (use space leader)
- [navigator] disable diagnostic on startup
- dynamic C-x: if number default or close window
- load custom/init.lua (autocommands) as vimscript file ?
- install neorg (neovim org mode)
- dynamic :w!! (daos or sudo)

@ -35,11 +35,13 @@ M.general = { --{{{
-- Window resizing
["<C-Left>"] = { "<cmd> vert res +2 <CR>", "window width +" },
["<C-Right>"] = { "<cmd> vert res -2 <CR>", "window width -" },
["<C-Left>"] = { "<cmd> vert res -2 <CR>", "window width +" },
["<C-Right>"] = { "<cmd> vert res +2 <CR>", "window width -" },
["<C-Up>"] = { "<cmd>res +2 <CR>", "window height +" },
["<C-Down>"] = { "<cmd>res -2 <CR>", "window height -" },
["<leader>="] = { "<C-w>=", "adjust viewports "},
-- quit dont save
["<leader>qq"] = { "<cmd> quitall! <cr>", "quit/close all windows, don't save" },
@ -141,7 +143,7 @@ M.general = { --{{{
["<leader>f9"] = { ":set foldlevel=9<CR>", "set fold level" },
["<leader>en"] = { "<cmd> cn <CR>", "next error" },
["<leader>rp"] = { "<cmd> cp <CR>", "previous error" },
["<leader>ep"] = { "<cmd> cp <CR>", "previous error" },
["g."] = { ":cwd<CR>", "change dir to current file", opts = { remap = true } },
@ -160,6 +162,20 @@ M.general = { --{{{
},
---------------
-- Programming languages specifics
---------------
-- luadev
["<leader>ls"] = {"<cmd>Luadev<CR>", "Luadev scratch window"},
["<leader>ll"] = {"<Plug>(Luadev-RunLine)", "Luadev Run Line"},
["<leader>lr"] = {"<Plug>(Luadev-Run)", "Luadev Run over movement or text object"},
["<leader>lw"] = {"<Plug>(Luadev-RunWord)", "Luadev Run word under cursor"},
--
-- ["<leader>r"] = { "<NOP>", "Run action"},
-- config files
["<leader>ev"] = {"<cmd> source ~/.config/nvim/Session.vim<CR>" , "edit vim config"},
},
@ -195,6 +211,9 @@ M.general = { --{{{
-- Change Working Directory to that of the current file
["cwd"] = { "lcd %:p:h", "change dir to current file" },
["cd."] = { "lcd %:p:h", "change dir to current file" },
["w!!"] = { "w !doas tee %", "write file with root perms" },
["%%"] = { "<C-R>=fnameescape(expand('%:h')).'/'<cr>",
"alias to current working dir"},
}
} --}}}

@ -56,6 +56,7 @@ opt.iskeyword:remove(".")
opt.iskeyword:remove("#")
opt.iskeyword:remove("-")
opt.foldminlines = 3
opt.foldlevelstart = 0
opt.conceallevel=1 -- how to show text with :syn-conceal syntax

@ -4,6 +4,11 @@
-- local augroup = vim.api.nvim_create_augroup
-- local autocmd = vim.api.nvim_create_autocmd
-- window closing
-- TODO: using dynamic C-x command
-- if character under cursor is number
-- use normal C-x or close window
-- highlights {
vim.cmd [[

@ -9,10 +9,53 @@ local config = {
-- debug = true,
transparency = nil,
default_mapping = true,
-- keymaps = {
--
-- },
-- TODO: remap all keys to restore default keys maps like `gi`
icons = {
icons = true, -- set to false to use system default ( if you using a terminal does not have nerd/icon)
-- Code action
code_action_icon = ' ', -- "",
-- code lens
code_lens_action_icon = '👓',
-- Diagnostics
diagnostic_head = '🐛',
diagnostic_err = '📛',
diagnostic_warn = '👎',
diagnostic_info = [[👩]],
diagnostic_hint = [[💁]],
diagnostic_head_severity_1 = '🈲',
diagnostic_head_severity_2 = '☣️',
diagnostic_head_severity_3 = '👎',
diagnostic_head_description = '👹',
diagnostic_virtual_text = '🦊',
diagnostic_file = '🚑',
-- Values
value_changed = '📝',
value_definition = '🐶🍡', -- it is easier to see than 🦕
side_panel = {
section_separator = '',
line_num_left = '',
line_num_right = '',
inner_node = '├○',
outer_node = '╰○',
bracket_left = '',
bracket_right = '',
},
-- Treesitter
match_kinds = {
var = '', -- "👹", -- Vampaire
method = 'ƒ ', -- "🍔", -- mac
['function'] = '', -- "🤣", -- Fun
parameter = '', -- Pi
associated = '🤝',
namespace = '🚀',
type = '',
field = '🏈',
module = '📦',
flag = '🎏',
},
treesitter_defult = '🌲',
doc_symbols = '',
},
lsp = {
document_highlight = false,
mason = true,

@ -6,6 +6,17 @@ end
local options = {
-- treesitter config (not textobjects)
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
}
},
textobjects = {
enable = true,

@ -1,3 +1,5 @@
-- vim: foldlevel=0
return {
["nvim-treesitter/nvim-treesitter-textobjects"] = {
after = "nvim-treesitter",
@ -8,6 +10,7 @@ return {
["mfussenegger/nvim-dap"] = {
module = "dap"
},
-- side panel with symbols (replaced by Navigator :LspSymbols cmd)
-- ["liuchengxu/vista.vim"] = {
-- cmd = "Vista",
@ -15,6 +18,7 @@ return {
-- require("core.utils").load_mappings "vista"
-- end
-- },
--
["folke/which-key.nvim"] = {
disable = false,
},
@ -44,7 +48,7 @@ return {
cmd = "G*"
},
-- restore view
-- session and view
["vim-scripts/restore_view.vim"] = {},
["rmagatti/auto-session"] = {
config = function ()
@ -55,6 +59,8 @@ return {
}
end
},
-- text formatting and navigation
-- repeat operator for plugin commands
["tpope/vim-repeat"] = {
keys = {"."},
@ -67,13 +73,19 @@ return {
]]
end
},
["tpope/vim-surround"] = {},
--
-- misc general plugins
-- Read info files
--
["https://gitlab.com/HiPhish/info.vim.git"] = {
cmd = "Info",
setup = function()
require("custom.plugins.info").set_mappings()
end
},
-- snippets
["L3MON4D3/LuaSnip"] = {
config = function()
-- load default config first
@ -91,6 +103,8 @@ return {
}
end
},
-- LSP
["honza/vim-snippets"] = {
module = {"cmp", "cmp_nvim_lsp"},
event = "InsertEnter",
@ -106,8 +120,9 @@ return {
require("mason-lspconfig").setup({})
end,
},
-- ["ray-x/navigator.lua"] = {
["https://git.sp4ke.xyz/sp4ke/navigator.lua"] = {
--
-- ["https://git.sp4ke.xyz/sp4ke/navigator.lua"] = {
["ray-x/navigator.lua"] = {
after = "nvim-lspconfig",
requires = {"neovim/nvim-lspconfig", "ray-x/guihua.lua", "nvim-treesitter/nvim-treesitter"},
setup = function()
@ -120,5 +135,44 @@ return {
["ray-x/guihua.lua"] = {
module = "navigator",
run= "cd lua/fzy && make"
}
},
-- per language plugins
-- lua dev
["bfredl/nvim-luadev"] = {
cmd = "Luadev",
keys = {
"<Plug>(Luadev-RunLine)",
"<Plug>(Luadev-Run)",
"<Plug>(Luadev-RunWord)",
"<Plug>(Luadev-Complete)",
},
setup = function()
local autocmd = vim.api.nvim_create_autocmd
autocmd("FileType", {
pattern = "lua",
callback = function ()
vim.keymap.set({'n', 'i'}, '<leader>r', '<Plug>(Luadev-RunLine)', {
desc = "Luadev RunLine"
})
end,
})
end
},
["ii14/neorepl.nvim"] = {
cmd = "Repl",
after = "nvim-cmp",
setup = function ()
local autocmd = vim.api.nvim_create_autocmd
autocmd("FileType",{
pattern = "neorepl",
callback = function ()
require('cmp').setup.buffer({enabled = false})
end
})
end
}
}

Loading…
Cancel
Save