Many basic-ide changes
This commit is contained in:
parent
fec1213e44
commit
b77289d967
9 changed files with 88 additions and 28 deletions
|
@ -117,6 +117,7 @@ cmp.setup({
|
||||||
{ name = "luasnip" },
|
{ name = "luasnip" },
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
|
{ name = "nvim_lsp_signature_help" },
|
||||||
},
|
},
|
||||||
confirm_opts = {
|
confirm_opts = {
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
local enabled = false
|
local enabled = true
|
||||||
local status_ok, indent_blankline = pcall(require, "indent_blankline")
|
local status_ok, indent_blankline = pcall(require, "indent_blankline")
|
||||||
if (not enabled) or (not status_ok) then
|
if (not enabled) or (not status_ok) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
--indent_blankline.setup {
|
indent_blankline.setup {
|
||||||
-- char = "▏",
|
char = "▏",
|
||||||
-- show_trailing_blankline_indent = false,
|
show_trailing_blankline_indent = false,
|
||||||
-- show_first_indent_level = true,
|
show_first_indent_level = true,
|
||||||
-- use_treesitter = true,
|
use_treesitter = true,
|
||||||
-- show_current_context = true,
|
show_current_context = true,
|
||||||
-- buftype_exclude = { "terminal", "nofile" },
|
buftype_exclude = { "terminal", "nofile" },
|
||||||
-- filetype_exclude = {
|
filetype_exclude = {
|
||||||
-- "help",
|
"help",
|
||||||
-- "packer",
|
"packer",
|
||||||
-- "NvimTree",
|
"NvimTree",
|
||||||
-- },
|
},
|
||||||
--}
|
}
|
||||||
|
|
|
@ -31,8 +31,8 @@ keymap("n", "<C-Right>", ":vertical resize +2<CR>", opts)
|
||||||
-- Navigate buffers
|
-- Navigate buffers
|
||||||
keymap("n", "<M-l>", ":BufferLineCycleNext<CR>", opts)
|
keymap("n", "<M-l>", ":BufferLineCycleNext<CR>", opts)
|
||||||
keymap("n", "<M-h>", ":BufferLineCyclePrev<CR>", opts)
|
keymap("n", "<M-h>", ":BufferLineCyclePrev<CR>", opts)
|
||||||
keymap("n", "<H>", "<Nop>", opts)
|
keymap("n", "H", "<Nop>", opts)
|
||||||
keymap("n", "<L>", "<Nop>", opts)
|
keymap("n", "L", "<Nop>", opts)
|
||||||
keymap("n", "<M-L>", ":BufferLineMoveNext<CR>", opts)
|
keymap("n", "<M-L>", ":BufferLineMoveNext<CR>", opts)
|
||||||
keymap("n", "<M-H>", ":BufferLineMovePrev<CR>", opts)
|
keymap("n", "<M-H>", ":BufferLineMovePrev<CR>", opts)
|
||||||
for _, mode in ipairs({"n", "i", "v"}) do
|
for _, mode in ipairs({"n", "i", "v"}) do
|
||||||
|
@ -78,9 +78,38 @@ keymap("n", "<leader>ff", ":Telescope git_files<CR>", opts)
|
||||||
keymap("n", "<leader>ft", ":Telescope live_grep<CR>", opts)
|
keymap("n", "<leader>ft", ":Telescope live_grep<CR>", opts)
|
||||||
keymap("n", "<leader>fp", ":Telescope projects<CR>", opts)
|
keymap("n", "<leader>fp", ":Telescope projects<CR>", opts)
|
||||||
keymap("n", "<leader>fb", ":Telescope buffers<CR>", opts)
|
keymap("n", "<leader>fb", ":Telescope buffers<CR>", opts)
|
||||||
keymap("n", "<leader>fs", ":Telescope grep_string<CR>", opts)
|
-- keymap("n", "<leader>fs", ":Telescope grep_string<CR>", opts)
|
||||||
keymap("n", "<leader>fr", ":Telescope oldfiles<CR>", opts)
|
keymap("n", "<leader>fr", ":Telescope oldfiles<CR>", opts)
|
||||||
|
|
||||||
|
function vim.getVisualSelection()
|
||||||
|
vim.cmd('noau normal! "vy"')
|
||||||
|
local text = vim.fn.getreg('v')
|
||||||
|
vim.fn.setreg('v', {})
|
||||||
|
|
||||||
|
text = string.gsub(text, "\n", "")
|
||||||
|
if #text > 0 then
|
||||||
|
return text
|
||||||
|
else
|
||||||
|
return ''
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- keymap('n', '<space>fs', ':Telescope current_buffer_fuzzy_find<cr>', opts)
|
||||||
|
-- keymap('v', '<space>fs', function()
|
||||||
|
-- local tb = require('telescope.builtin')
|
||||||
|
-- local text = vim.getVisualSelection()
|
||||||
|
-- tb.current_buffer_fuzzy_find({ default_text = text })
|
||||||
|
-- end, opts)
|
||||||
|
|
||||||
|
keymap('n', '<space>fs', ':Telescope grep_string<cr>', opts)
|
||||||
|
keymap('v', '<space>fs', function()
|
||||||
|
local tb = require('telescope.builtin')
|
||||||
|
local text = vim.getVisualSelection()
|
||||||
|
tb.live_grep({ default_text = text })
|
||||||
|
end, opts)
|
||||||
|
|
||||||
-- Git
|
-- Git
|
||||||
--keymap("n", "<leader>gg", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
|
--keymap("n", "<leader>gg", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
|
||||||
|
|
||||||
|
@ -129,12 +158,6 @@ keymap("i", "<Down>", "<Nop>", opts)
|
||||||
keymap("n", "j", "gj")
|
keymap("n", "j", "gj")
|
||||||
keymap("n", "k", "gk")
|
keymap("n", "k", "gk")
|
||||||
|
|
||||||
-- use Alt + ijkl to move in insert mode
|
|
||||||
keymap("i", "<M-l>", "<Right>", opts)
|
|
||||||
keymap("i", "<M-h>", "<Left>", opts)
|
|
||||||
keymap("i", "<M-j>", "<C-o>gj", opts)
|
|
||||||
keymap("i", "<M-k>", "<C-o>gk", opts)
|
|
||||||
|
|
||||||
local function clean_screen()
|
local function clean_screen()
|
||||||
vim.o.number = not vim.o.number;
|
vim.o.number = not vim.o.number;
|
||||||
--if not vim.diagnostic.get_next() then return end
|
--if not vim.diagnostic.get_next() then return end
|
||||||
|
|
|
@ -5,9 +5,10 @@ if not status_cmp_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
M.capabilities = vim.lsp.protocol.make_client_capabilities()
|
-- M.capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
M.capabilities = cmp_nvim_lsp.default_capabilities()
|
||||||
M.capabilities.textDocument.completion.completionItem.snippetSupport = true
|
M.capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
M.capabilities = cmp_nvim_lsp.update_capabilities(M.capabilities)
|
-- M.capabilities = cmp_nvim_lsp.update_capabilities(M.capabilities)
|
||||||
|
|
||||||
M.setup = function()
|
M.setup = function()
|
||||||
local signs = {
|
local signs = {
|
||||||
|
|
|
@ -10,7 +10,8 @@ local servers = {
|
||||||
"rust_analyzer",
|
"rust_analyzer",
|
||||||
"gopls",
|
"gopls",
|
||||||
"clangd",
|
"clangd",
|
||||||
"taplo"
|
"taplo",
|
||||||
|
"phpactor",
|
||||||
}
|
}
|
||||||
|
|
||||||
local settings = {
|
local settings = {
|
||||||
|
|
7
lua/user/lsp/settings/yamlls.lua
Normal file
7
lua/user/lsp/settings/yamlls.lua
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
yaml = {
|
||||||
|
keyOrdering = false
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
11
lua/user/lsp/signature.lua
Normal file
11
lua/user/lsp/signature.lua
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
local ok, lsp_signature = pcall(require, "lsp_signature")
|
||||||
|
if not ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
lsp_signature.setup({
|
||||||
|
bind = true,
|
||||||
|
handler_opts = {
|
||||||
|
border = "rounded",
|
||||||
|
},
|
||||||
|
})
|
|
@ -57,7 +57,7 @@ return packer.startup(function(use)
|
||||||
use({ "akinsho/toggleterm.nvim", commit = "2a787c426ef00cb3488c11b14f5dcf892bbd0bda" })
|
use({ "akinsho/toggleterm.nvim", commit = "2a787c426ef00cb3488c11b14f5dcf892bbd0bda" })
|
||||||
use({ "ahmedkhalf/project.nvim", commit = "628de7e433dd503e782831fe150bb750e56e55d6" })
|
use({ "ahmedkhalf/project.nvim", commit = "628de7e433dd503e782831fe150bb750e56e55d6" })
|
||||||
use({ "lewis6991/impatient.nvim", commit = "b842e16ecc1a700f62adb9802f8355b99b52a5a6" })
|
use({ "lewis6991/impatient.nvim", commit = "b842e16ecc1a700f62adb9802f8355b99b52a5a6" })
|
||||||
--use { "lukas-reineke/indent-blankline.nvim", commit = "db7cbcb40cc00fc5d6074d7569fb37197705e7f6" }
|
use { "lukas-reineke/indent-blankline.nvim", commit = "db7cbcb40cc00fc5d6074d7569fb37197705e7f6" }
|
||||||
use({ "goolord/alpha-nvim", commit = "0bb6fc0646bcd1cdb4639737a1cee8d6e08bcc31" })
|
use({ "goolord/alpha-nvim", commit = "0bb6fc0646bcd1cdb4639737a1cee8d6e08bcc31" })
|
||||||
|
|
||||||
-- Colorschemes
|
-- Colorschemes
|
||||||
|
@ -70,7 +70,8 @@ return packer.startup(function(use)
|
||||||
use({ "hrsh7th/cmp-buffer", commit = "3022dbc9166796b644a841a02de8dd1cc1d311fa" }) -- buffer completions
|
use({ "hrsh7th/cmp-buffer", commit = "3022dbc9166796b644a841a02de8dd1cc1d311fa" }) -- buffer completions
|
||||||
use({ "hrsh7th/cmp-path", commit = "447c87cdd6e6d6a1d2488b1d43108bfa217f56e1" }) -- path completions
|
use({ "hrsh7th/cmp-path", commit = "447c87cdd6e6d6a1d2488b1d43108bfa217f56e1" }) -- path completions
|
||||||
use({ "saadparwaiz1/cmp_luasnip", commit = "a9de941bcbda508d0a45d28ae366bb3f08db2e36" }) -- snippet completions
|
use({ "saadparwaiz1/cmp_luasnip", commit = "a9de941bcbda508d0a45d28ae366bb3f08db2e36" }) -- snippet completions
|
||||||
use({ "hrsh7th/cmp-nvim-lsp", commit = "affe808a5c56b71630f17aa7c38e15c59fd648a8" })
|
use({ "hrsh7th/cmp-nvim-lsp" })
|
||||||
|
use({ "hrsh7th/cmp-nvim-lsp-signature-help" })
|
||||||
use({ "hrsh7th/cmp-nvim-lua", commit = "d276254e7198ab7d00f117e88e223b4bd8c02d21" })
|
use({ "hrsh7th/cmp-nvim-lua", commit = "d276254e7198ab7d00f117e88e223b4bd8c02d21" })
|
||||||
|
|
||||||
-- snippets
|
-- snippets
|
||||||
|
@ -121,6 +122,9 @@ return packer.startup(function(use)
|
||||||
use({ "mbbill/undotree" })
|
use({ "mbbill/undotree" })
|
||||||
|
|
||||||
use({ "folke/trouble.nvim" })
|
use({ "folke/trouble.nvim" })
|
||||||
|
use({ 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' })
|
||||||
|
-- use({ "ray-x/lsp_signature.nvim" })
|
||||||
|
use({ "ray-x/lsp_signature.nvim" })
|
||||||
|
|
||||||
-- Automatically set up your configuration after cloning packer.nvim
|
-- Automatically set up your configuration after cloning packer.nvim
|
||||||
-- Put this at the end after all plugins
|
-- Put this at the end after all plugins
|
||||||
|
|
|
@ -21,5 +21,17 @@ telescope.setup {
|
||||||
["<C-k>"] = actions.move_selection_previous,
|
["<C-k>"] = actions.move_selection_previous,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
extensions = {
|
||||||
|
fzf = {
|
||||||
|
fuzzy = true, -- false will only do exact matching
|
||||||
|
override_generic_sorter = true, -- override the generic sorter
|
||||||
|
override_file_sorter = true, -- override the file sorter
|
||||||
|
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||||
|
-- the default case_mode is "smart_case"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
telescope.load_extension('fzf')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue