mirror of
https://github.com/sadan4/nvim.git
synced 2024-11-16 22:34:39 -05:00
a
This commit is contained in:
parent
c2daf1e3f3
commit
e649c257a1
7 changed files with 43 additions and 8 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
lazy-lock.json
|
|
@ -14,16 +14,29 @@ vim.keymap.set("n", "<C-f>d", tb.man_pages, {})
|
||||||
-- open tree
|
-- open tree
|
||||||
vim.keymap.set({ "i", "n" }, "<C-t>", vim.cmd.NvimTreeFocus, {})
|
vim.keymap.set({ "i", "n" }, "<C-t>", vim.cmd.NvimTreeFocus, {})
|
||||||
-- move and copy lines
|
-- 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-Up>", function()
|
||||||
vim.keymap.set({ "i", "n" }, "<A-Down>", function()vim.api.nvim_feedkeys("ddp", "x", false)end, {})
|
vim.api.nvim_feedkeys("ddkP", "x", false)
|
||||||
vim.keymap.set({ "i", "n" }, "<A-S-Up>", function()vim.api.nvim_feedkeys("yyP", "x", false)end, {})
|
end, {})
|
||||||
vim.keymap.set({ "i", "n" }, "<A-S-Down>", function()vim.api.nvim_feedkeys("yyp", "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
|
-- on <C-Space> in normal, insert and start autoComp
|
||||||
vim.keymap.set("n", "<C-Space>", function()
|
vim.keymap.set("n", "<C-Space>", function()
|
||||||
vim.api.nvim_feedkeys("i", "m", false)
|
vim.api.nvim_feedkeys("i", "m", false)
|
||||||
local key1 = vim.api.nvim_replace_termcodes("<C-Space>", true, false, true)
|
local key1 = vim.api.nvim_replace_termcodes("<C-Space>", true, false, true)
|
||||||
vim.api.nvim_feedkeys(key1, "m", false)
|
vim.api.nvim_feedkeys(key1, "m", false)
|
||||||
end, {})
|
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({ "n", "i" }, "<A-F>", vim.cmd.Format, {})
|
||||||
vim.keymap.set({ "i", "n" }, "<C-\\>", vim.cmd.vsplit, {})
|
vim.keymap.set({ "i", "n" }, "<C-\\>", vim.cmd.vsplit, {})
|
||||||
-- vscode fold and unfold
|
-- vscode fold and unfold
|
||||||
|
|
|
@ -2,6 +2,9 @@ local plugins = {
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ray-x/lsp_signature.nvim"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
},
|
},
|
||||||
|
|
|
@ -16,3 +16,5 @@ require("setuptabout")
|
||||||
require("setupufo")
|
require("setupufo")
|
||||||
|
|
||||||
require("setupcomment")
|
require("setupcomment")
|
||||||
|
-- setup function signature
|
||||||
|
require("setupsig")
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
-- https://github.com/mhartington/formatter.nvim/tree/master/lua/formatter/filetypes
|
-- https://github.com/mhartington/formatter.nvim/tree/master/lua/formatter/filetypes
|
||||||
-- Utilities for creating configurations
|
-- Utilities for creating configurations
|
||||||
local util = require("formatter.util")
|
local util = require("formatter.util")
|
||||||
|
local defaults = require("formatter.defaults")
|
||||||
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
|
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
|
||||||
require("formatter").setup({
|
require("formatter").setup({
|
||||||
-- Enable or disable logging
|
-- Enable or disable logging
|
||||||
|
@ -13,6 +13,10 @@ require("formatter").setup({
|
||||||
filetype = {
|
filetype = {
|
||||||
-- Formatter configurations for filetype "lua" go here
|
-- Formatter configurations for filetype "lua" go here
|
||||||
-- and will be executed in order
|
-- and will be executed in order
|
||||||
|
typescript = {
|
||||||
|
require("formatter.filetypes.typescript").eslint_d,
|
||||||
|
util.copyf(defaults.eslint_d),
|
||||||
|
},
|
||||||
kotlin = {
|
kotlin = {
|
||||||
require("formatter.filetypes.kotlin").ktlint,
|
require("formatter.filetypes.kotlin").ktlint,
|
||||||
function()
|
function()
|
||||||
|
|
|
@ -5,6 +5,12 @@ capabilities.textDocument.foldingRange = {
|
||||||
dynamicRegistration = false,
|
dynamicRegistration = false,
|
||||||
lineFoldingOnly = true,
|
lineFoldingOnly = true,
|
||||||
}
|
}
|
||||||
|
require("lspconfig").pyright.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
require("lspconfig").tsserver.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
--
|
--
|
||||||
require("lspconfig").kotlin_language_server.setup({
|
require("lspconfig").kotlin_language_server.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
@ -48,7 +54,7 @@ require("lspconfig").lua_ls.setup({
|
||||||
})
|
})
|
||||||
|
|
||||||
local luasnip = require("luasnip")
|
local luasnip = require("luasnip")
|
||||||
|
local pairs = require("nvim-autopairs.completion.cmp")
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
snippet = {
|
snippet = {
|
||||||
|
@ -60,7 +66,7 @@ cmp.setup({
|
||||||
-- ['<C-u>'] = cmp.mapping.scroll_docs(-4), -- Up
|
-- ['<C-u>'] = cmp.mapping.scroll_docs(-4), -- Up
|
||||||
-- ['<C-d>'] = cmp.mapping.scroll_docs(4), -- Down
|
-- ['<C-d>'] = cmp.mapping.scroll_docs(4), -- Down
|
||||||
-- C-b (back) C-f (forward) for snippet placeholder navigation.
|
-- C-b (back) C-f (forward) for snippet placeholder navigation.
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
["<CR>"] = cmp.mapping.confirm({
|
["<CR>"] = cmp.mapping.confirm({
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
select = true,
|
select = true,
|
||||||
|
@ -87,5 +93,7 @@ cmp.setup({
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
{ name = "luasnip" },
|
{ name = "luasnip" },
|
||||||
|
{ name = "hrsh7th/cmp-nvim-lsp-signature-help" },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
cmp.event:on("confirm_done", pairs.on_confirm_done())
|
||||||
|
|
4
lua/setupsig.lua
Normal file
4
lua/setupsig.lua
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
local cfg = {
|
||||||
|
hint_enable = false,
|
||||||
|
} -- add your config here
|
||||||
|
require("lsp_signature").setup(cfg)
|
Loading…
Reference in a new issue