Try folds and some other changes
This commit is contained in:
parent
50b8c88e92
commit
a56b8f7029
5
init.lua
5
init.lua
@ -42,5 +42,10 @@ vim.opt.expandtab = false
|
|||||||
vim.opt.autoindent = true
|
vim.opt.autoindent = true
|
||||||
vim.opt.smartindent = true
|
vim.opt.smartindent = true
|
||||||
vim.opt.completeopt = { "menu", "menuone", "noselect" }
|
vim.opt.completeopt = { "menu", "menuone", "noselect" }
|
||||||
|
vim.opt.foldmethod = "expr"
|
||||||
|
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||||
|
vim.opt.foldtext = ""
|
||||||
|
vim.opt.foldlevelstart = 1
|
||||||
|
vim.opt.foldnestmax = 2
|
||||||
|
|
||||||
-- TODO replace config with opts in every plugin
|
-- TODO replace config with opts in every plugin
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'mfussenegger/nvim-dap',
|
'mfussenegger/nvim-dap',
|
||||||
|
lazy = true,
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
config = function()
|
config = function()
|
||||||
local wk = require("which-key")
|
local wk = require("which-key")
|
||||||
@ -17,6 +18,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
'rcarriga/nvim-dap-ui',
|
'rcarriga/nvim-dap-ui',
|
||||||
|
lazy = true,
|
||||||
config = function()
|
config = function()
|
||||||
local dapui = require("dapui")
|
local dapui = require("dapui")
|
||||||
dapui.setup()
|
dapui.setup()
|
||||||
@ -29,6 +31,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
'theHamsta/nvim-dap-virtual-text',
|
'theHamsta/nvim-dap-virtual-text',
|
||||||
|
lazy = true,
|
||||||
config = true
|
config = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,26 @@
|
|||||||
local lsp_attach = function(client, buf)
|
local lsp_attach = function(client, buf)
|
||||||
vim.api.nvim_buf_set_option(buf, "formatexpr", "v:lua.vim.lsp.formatexpr()")
|
vim.api.nvim_set_option_value("formatexpr", "v:lua.vim.lsp.formatexpr()", { buf = buf })
|
||||||
vim.api.nvim_buf_set_option(buf, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
vim.api.nvim_set_option_value("omnifunc", "v:lua.vim.lsp.omnifunc", { buf = buf })
|
||||||
vim.api.nvim_buf_set_option(buf, "tagfunc", "v:lua.vim.lsp.tagfunc")
|
vim.api.nvim_set_option_value("tagfunc", "v:lua.vim.lsp.tagfunc", { buf = buf })
|
||||||
|
|
||||||
vim.lsp.inlay_hint.enable(true, nil)
|
vim.lsp.inlay_hint.enable(true, nil)
|
||||||
|
|
||||||
local bufopts = { noremap = true, silent = true, buffer = buf }
|
local bufopts = { noremap = true, silent = true, buffer = buf }
|
||||||
local wk = require("which-key")
|
local wk = require("which-key")
|
||||||
|
|
||||||
|
local diag_next = function()
|
||||||
|
vim.diagnostic.jump({ count = 1, float = true })
|
||||||
|
end
|
||||||
|
|
||||||
|
local diag_prev = function()
|
||||||
|
vim.diagnostic.jump({ count = -1, float = true })
|
||||||
|
end
|
||||||
|
|
||||||
wk.add({
|
wk.add({
|
||||||
{ '<leader>e', vim.diagnostic.open_float, bufopts, desc = "Show diagnostics in buffer" },
|
|
||||||
{ '<C-e>', require("telescope.builtin").diagnostics, bufopts, desc = "Show diagnostics under cursor" },
|
{ '<C-e>', require("telescope.builtin").diagnostics, bufopts, desc = "Show diagnostics under cursor" },
|
||||||
{ '<C-ü>d', vim.diagnostic.goto_prev, bufopts },
|
{ '<leader>e', vim.diagnostic.open_float, bufopts, desc = "Show diagnostics in buffer" },
|
||||||
{ '<C-¨>d', vim.diagnostic.goto_next, bufopts },
|
{ '[d', diag_prev, bufopts },
|
||||||
|
{ ']d', diag_next, bufopts },
|
||||||
|
|
||||||
{ 'gD', vim.lsp.buf.declaration, bufopts, desc = "Go to declaration" },
|
{ 'gD', vim.lsp.buf.declaration, bufopts, desc = "Go to declaration" },
|
||||||
{ 'gd', vim.lsp.buf.definition, bufopts, desc = "Go to definition" },
|
{ 'gd', vim.lsp.buf.definition, bufopts, desc = "Go to definition" },
|
||||||
@ -36,6 +44,7 @@ return {
|
|||||||
-- lsp
|
-- lsp
|
||||||
{
|
{
|
||||||
'williamboman/mason.nvim',
|
'williamboman/mason.nvim',
|
||||||
|
lazy = true,
|
||||||
config = true
|
config = true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -7,15 +7,17 @@ return {
|
|||||||
local telescope = require("telescope.builtin")
|
local telescope = require("telescope.builtin")
|
||||||
local wk = require("which-key")
|
local wk = require("which-key")
|
||||||
wk.add({
|
wk.add({
|
||||||
{ "<leader>gh", telescope.git_bcommits, { noremap = true, silent = true, group = "git", desc = "View commits of current buffer" } },
|
{ "<leader>g", group = "git" },
|
||||||
{ "<leader>gb", telescope.git_branches, { noremap = true, silent = true, group = "git", desc = "View git branches" } },
|
{ "<leader>gh", telescope.git_bcommits, { noremap = true, silent = true }, desc = "View commits of current buffer" },
|
||||||
{ "<leader>gs", telescope.git_status, { noremap = true, silent = true, group = "git", desc = "View git status" } },
|
{ "<leader>gb", telescope.git_branches, { noremap = true, silent = true }, desc = "View git branches" },
|
||||||
{ '<Leader>ff', telescope.git_files, { noremap = true, silent = true, desc = "Search files" } },
|
{ "<leader>gs", telescope.git_status, { noremap = true, silent = true }, desc = "View git status" },
|
||||||
{ '<Leader>fg', telescope.live_grep, { noremap = true, silent = true, desc = "Search in files" } },
|
{ "<leader>f", group = "find" },
|
||||||
{ '<Leader>fb', telescope.buffers, { noremap = true, silent = true, desc = "Search in buffers" } },
|
{ '<Leader>ff', telescope.git_files, { noremap = true, silent = true }, desc = "Search files" },
|
||||||
{ '<Leader>fh', telescope.help_tags, { noremap = true, silent = true, desc = "Search in help" } },
|
{ '<Leader>fg', telescope.live_grep, { noremap = true, silent = true }, desc = "Search in files" },
|
||||||
{ '<Leader>fk', telescope.keymaps, { noremap = true, silent = true, desc = "Search in keymaps" } },
|
{ '<Leader>fb', telescope.buffers, { noremap = true, silent = true }, desc = "Search in buffers" },
|
||||||
{ '<leader>cc', telescope.colorscheme, { desc = "Select colorscheme" } },
|
{ '<Leader>fh', telescope.help_tags, { noremap = true, silent = true }, desc = "Search in help" },
|
||||||
|
{ '<Leader>fk', telescope.keymaps, { noremap = true, silent = true }, desc = "Search in keymaps" },
|
||||||
|
{ '<leader>cc', telescope.colorscheme, desc = "Select colorscheme" },
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
@ -5,20 +5,21 @@ return {
|
|||||||
vim.opt.guifont = 'Source Code Pro for Powerline'
|
vim.opt.guifont = 'Source Code Pro for Powerline'
|
||||||
vim.cmd('set termguicolors')
|
vim.cmd('set termguicolors')
|
||||||
vim.opt.syntax = 'on'
|
vim.opt.syntax = 'on'
|
||||||
require('kanagawa').setup({
|
-- require('kanagawa').setup({
|
||||||
colors = {
|
-- colors = {
|
||||||
palette = {
|
-- palette = {
|
||||||
lotusGray = "#F8F7F4",
|
-- lotusGray = "#F8F7F4",
|
||||||
lotusWhite0 = "#FBFBF9",
|
-- lotusWhite0 = "#FBFBF9",
|
||||||
lotusWhite1 = "#F2F0E9",
|
-- lotusWhite1 = "#F2F0E9",
|
||||||
lotusWhite2 = "#F8F7F2",
|
-- lotusWhite2 = "#F8F7F2",
|
||||||
lotusWhite3 = "#F6F6F1",
|
-- lotusWhite3 = "#F6F6F1",
|
||||||
lotusWhite4 = "#F4F1E6",
|
-- lotusWhite4 = "#F4F1E6",
|
||||||
lotusWhite5 = "#FcFBF9",
|
-- lotusWhite5 = "#FcFBF9",
|
||||||
}
|
-- }
|
||||||
}
|
-- }
|
||||||
})
|
-- })
|
||||||
vim.cmd('colorscheme kanagawa-lotus')
|
-- vim.cmd('colorscheme kanagawa-lotus')
|
||||||
|
vim.cmd('colorscheme kanagawa')
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{ 'lunarvim/lunar.nvim' },
|
{ 'lunarvim/lunar.nvim' },
|
||||||
@ -37,7 +38,6 @@ return {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
dependencies = { 'nvim-treesitter/playground' }
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter-context",
|
"nvim-treesitter/nvim-treesitter-context",
|
||||||
@ -92,10 +92,4 @@ return {
|
|||||||
'lewis6991/gitsigns.nvim',
|
'lewis6991/gitsigns.nvim',
|
||||||
config = true
|
config = true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
'glepnir/dashboard-nvim',
|
|
||||||
event = 'VimEnter',
|
|
||||||
config = true,
|
|
||||||
dependencies = { 'nvim-tree/nvim-web-devicons' }
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user