This commit is contained in:
sadanslargehole 2024-03-12 15:22:20 -04:00
parent c2daf1e3f3
commit e649c257a1
No known key found for this signature in database
GPG key ID: B2E2F4A5161A7800
7 changed files with 43 additions and 8 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
lazy-lock.json

View file

@ -14,16 +14,29 @@ vim.keymap.set("n", "<C-f>d", tb.man_pages, {})
-- open tree
vim.keymap.set({ "i", "n" }, "<C-t>", vim.cmd.NvimTreeFocus, {})
-- move and copy lines
vim.keymap.set({ "i", "n" }, "<A-Up>", function()vim.api.nvim_feedkeys("ddkP", "x", false)end, {})
vim.keymap.set({ "i", "n" }, "<A-Down>", function()vim.api.nvim_feedkeys("ddp", "x", false)end, {})
vim.keymap.set({ "i", "n" }, "<A-S-Up>", function()vim.api.nvim_feedkeys("yyP", "x", false)end, {})
vim.keymap.set({ "i", "n" }, "<A-S-Down>", function()vim.api.nvim_feedkeys("yyp", "x", false)end, {})
vim.keymap.set({ "i", "n" }, "<A-Up>", function()
vim.api.nvim_feedkeys("ddkP", "x", false)
end, {})
vim.keymap.set({ "i", "n" }, "<A-Down>", function()
vim.api.nvim_feedkeys("ddp", "x", false)
end, {})
vim.keymap.set({ "i", "n" }, "<A-S-Up>", function()
vim.api.nvim_feedkeys("yyP", "x", false)
end, {})
vim.keymap.set({ "i", "n" }, "<A-S-Down>", function()
vim.api.nvim_feedkeys("yyp", "x", false)
end, {})
-- on <C-Space> in normal, insert and start autoComp
vim.keymap.set("n", "<C-Space>", function()
vim.api.nvim_feedkeys("i", "m", false)
local key1 = vim.api.nvim_replace_termcodes("<C-Space>", true, false, true)
vim.api.nvim_feedkeys(key1, "m", false)
end, {})
-- toggle function signature
vim.keymap.set("i", "<C-S-Space>", function()
require("lsp_signature").toggle_float_win()
end, {})
-- format and vplit remaps
vim.keymap.set({ "n", "i" }, "<A-F>", vim.cmd.Format, {})
vim.keymap.set({ "i", "n" }, "<C-\\>", vim.cmd.vsplit, {})
-- vscode fold and unfold

View file

@ -2,6 +2,9 @@ local plugins = {
{
"williamboman/mason.nvim",
},
{
"ray-x/lsp_signature.nvim"
},
{
"williamboman/mason-lspconfig.nvim",
},

View file

@ -16,3 +16,5 @@ require("setuptabout")
require("setupufo")
require("setupcomment")
-- setup function signature
require("setupsig")

View file

@ -2,7 +2,7 @@
-- https://github.com/mhartington/formatter.nvim/tree/master/lua/formatter/filetypes
-- Utilities for creating configurations
local util = require("formatter.util")
local defaults = require("formatter.defaults")
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
require("formatter").setup({
-- Enable or disable logging
@ -13,6 +13,10 @@ require("formatter").setup({
filetype = {
-- Formatter configurations for filetype "lua" go here
-- and will be executed in order
typescript = {
require("formatter.filetypes.typescript").eslint_d,
util.copyf(defaults.eslint_d),
},
kotlin = {
require("formatter.filetypes.kotlin").ktlint,
function()

View file

@ -5,6 +5,12 @@ capabilities.textDocument.foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true,
}
require("lspconfig").pyright.setup({
capabilities = capabilities,
})
require("lspconfig").tsserver.setup({
capabilities = capabilities,
})
--
require("lspconfig").kotlin_language_server.setup({
capabilities = capabilities,
@ -48,7 +54,7 @@ require("lspconfig").lua_ls.setup({
})
local luasnip = require("luasnip")
local pairs = require("nvim-autopairs.completion.cmp")
local cmp = require("cmp")
cmp.setup({
snippet = {
@ -60,7 +66,7 @@ cmp.setup({
-- ['<C-u>'] = cmp.mapping.scroll_docs(-4), -- Up
-- ['<C-d>'] = cmp.mapping.scroll_docs(4), -- Down
-- C-b (back) C-f (forward) for snippet placeholder navigation.
['<C-Space>'] = cmp.mapping.complete(),
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
@ -87,5 +93,7 @@ cmp.setup({
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "hrsh7th/cmp-nvim-lsp-signature-help" },
},
})
cmp.event:on("confirm_done", pairs.on_confirm_done())

4
lua/setupsig.lua Normal file
View file

@ -0,0 +1,4 @@
local cfg = {
hint_enable = false,
} -- add your config here
require("lsp_signature").setup(cfg)