Compare commits
3 commits
b883b4be2c
...
b77289d967
Author | SHA1 | Date | |
---|---|---|---|
|
b77289d967 | ||
fec1213e44 | |||
bbe5d66d1e |
10 changed files with 100 additions and 75 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 = {
|
||||||
|
@ -54,38 +55,3 @@ for _, server in pairs(servers) do
|
||||||
|
|
||||||
lspconfig[server].setup(opts)
|
lspconfig[server].setup(opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
local mason_nvim_dap_ok, mason_nvim_dap = pcall(require, "mason-nvim-dap")
|
|
||||||
if mason_nvim_dap_ok then
|
|
||||||
local dap = require('dap')
|
|
||||||
mason_nvim_dap.setup({
|
|
||||||
automatic_setup = true,
|
|
||||||
})
|
|
||||||
mason_nvim_dap.setup_handlers({
|
|
||||||
function(source_name)
|
|
||||||
-- all sources with no handler get passed here
|
|
||||||
|
|
||||||
-- Keep original functionality of `automatic_setup = true`
|
|
||||||
require("mason-nvim-dap.automatic_setup")(source_name)
|
|
||||||
end,
|
|
||||||
python = function(source_name)
|
|
||||||
dap.adapters.python = {
|
|
||||||
type = "executable",
|
|
||||||
command = "/usr/bin/python3",
|
|
||||||
args = {
|
|
||||||
"-m",
|
|
||||||
"debugpy.adapter",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
dap.configurations.python = {
|
|
||||||
{
|
|
||||||
type = "python",
|
|
||||||
request = "launch",
|
|
||||||
name = "Launch file",
|
|
||||||
program = "${file}", -- This configuration will launch the current file if used.
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
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",
|
||||||
|
},
|
||||||
|
})
|
|
@ -12,30 +12,30 @@ local diagnostics = {
|
||||||
sources = { "nvim_diagnostic" },
|
sources = { "nvim_diagnostic" },
|
||||||
sections = { "error", "warn" },
|
sections = { "error", "warn" },
|
||||||
symbols = { error = " ", warn = " " },
|
symbols = { error = " ", warn = " " },
|
||||||
colored = false,
|
colored = true,
|
||||||
always_visible = true,
|
always_visible = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
local diff = {
|
local diff = {
|
||||||
"diff",
|
"diff",
|
||||||
colored = false,
|
colored = true,
|
||||||
symbols = { added = "", modified = "", removed = "" }, -- changes diff symbols
|
symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
|
||||||
cond = hide_in_width,
|
cond = hide_in_width,
|
||||||
}
|
}
|
||||||
|
|
||||||
local filetype = {
|
local filetype = {
|
||||||
"filetype",
|
"filetype",
|
||||||
icons_enabled = false,
|
icons_enabled = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
local location = {
|
local location = {
|
||||||
"location",
|
"location",
|
||||||
padding = 0,
|
padding = { right = 1 },
|
||||||
}
|
}
|
||||||
|
|
||||||
local spaces = function()
|
-- local spaces = function()
|
||||||
return "spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
-- return "spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||||
end
|
-- end
|
||||||
|
|
||||||
lualine.setup {
|
lualine.setup {
|
||||||
options = {
|
options = {
|
||||||
|
@ -51,7 +51,7 @@ lualine.setup {
|
||||||
lualine_a = { "mode" },
|
lualine_a = { "mode" },
|
||||||
lualine_b = {"branch"},
|
lualine_b = {"branch"},
|
||||||
lualine_c = { diagnostics },
|
lualine_c = { diagnostics },
|
||||||
lualine_x = { diff, spaces, "encoding", filetype },
|
lualine_x = { diff, filetype },
|
||||||
lualine_y = { location },
|
lualine_y = { location },
|
||||||
lualine_z = { "progress" },
|
lualine_z = { "progress" },
|
||||||
},
|
},
|
||||||
|
|
|
@ -53,11 +53,11 @@ return packer.startup(function(use)
|
||||||
use({ "kyazdani42/nvim-tree.lua", commit = "7282f7de8aedf861fe0162a559fc2b214383c51c" })
|
use({ "kyazdani42/nvim-tree.lua", commit = "7282f7de8aedf861fe0162a559fc2b214383c51c" })
|
||||||
use({ "akinsho/bufferline.nvim", commit = "83bf4dc7bff642e145c8b4547aa596803a8b4dc4" })
|
use({ "akinsho/bufferline.nvim", commit = "83bf4dc7bff642e145c8b4547aa596803a8b4dc4" })
|
||||||
use({ "moll/vim-bbye", commit = "25ef93ac5a87526111f43e5110675032dbcacf56" })
|
use({ "moll/vim-bbye", commit = "25ef93ac5a87526111f43e5110675032dbcacf56" })
|
||||||
use({ "nvim-lualine/lualine.nvim", commit = "a52f078026b27694d2290e34efa61a6e4a690621" })
|
use({ "nvim-lualine/lualine.nvim" })
|
||||||
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
|
||||||
|
@ -91,11 +92,9 @@ return packer.startup(function(use)
|
||||||
-- Treesitter
|
-- Treesitter
|
||||||
use({
|
use({
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
commit = "1942f3554184e9d9dfb90dcc6542047b8f6511f2",
|
|
||||||
})
|
})
|
||||||
use({
|
use({
|
||||||
"nvim-treesitter/nvim-treesitter-context",
|
"nvim-treesitter/nvim-treesitter-context",
|
||||||
commit = "0dd5eae6dbf226107da2c2041ffbb695d9e267c1",
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Git
|
-- Git
|
||||||
|
@ -122,6 +121,11 @@ return packer.startup(function(use)
|
||||||
|
|
||||||
use({ "mbbill/undotree" })
|
use({ "mbbill/undotree" })
|
||||||
|
|
||||||
|
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
|
||||||
if PACKER_BOOTSTRAP then
|
if PACKER_BOOTSTRAP then
|
||||||
|
|
|
@ -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