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.smartindent = true
|
||||
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
|
||||
|
@ -1,6 +1,7 @@
|
||||
return {
|
||||
{
|
||||
'mfussenegger/nvim-dap',
|
||||
lazy = true,
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
local wk = require("which-key")
|
||||
@ -17,6 +18,7 @@ return {
|
||||
},
|
||||
{
|
||||
'rcarriga/nvim-dap-ui',
|
||||
lazy = true,
|
||||
config = function()
|
||||
local dapui = require("dapui")
|
||||
dapui.setup()
|
||||
@ -29,6 +31,7 @@ return {
|
||||
},
|
||||
{
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
lazy = true,
|
||||
config = true
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +1,26 @@
|
||||
local lsp_attach = function(client, buf)
|
||||
vim.api.nvim_buf_set_option(buf, "formatexpr", "v:lua.vim.lsp.formatexpr()")
|
||||
vim.api.nvim_buf_set_option(buf, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
vim.api.nvim_buf_set_option(buf, "tagfunc", "v:lua.vim.lsp.tagfunc")
|
||||
vim.api.nvim_set_option_value("formatexpr", "v:lua.vim.lsp.formatexpr()", { buf = buf })
|
||||
vim.api.nvim_set_option_value("omnifunc", "v:lua.vim.lsp.omnifunc", { buf = buf })
|
||||
vim.api.nvim_set_option_value("tagfunc", "v:lua.vim.lsp.tagfunc", { buf = buf })
|
||||
|
||||
vim.lsp.inlay_hint.enable(true, nil)
|
||||
|
||||
local bufopts = { noremap = true, silent = true, buffer = buf }
|
||||
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({
|
||||
{ '<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-ü>d', vim.diagnostic.goto_prev, bufopts },
|
||||
{ '<C-¨>d', vim.diagnostic.goto_next, bufopts },
|
||||
{ '<leader>e', vim.diagnostic.open_float, bufopts, desc = "Show diagnostics in buffer" },
|
||||
{ '[d', diag_prev, bufopts },
|
||||
{ ']d', diag_next, bufopts },
|
||||
|
||||
{ 'gD', vim.lsp.buf.declaration, bufopts, desc = "Go to declaration" },
|
||||
{ 'gd', vim.lsp.buf.definition, bufopts, desc = "Go to definition" },
|
||||
@ -36,6 +44,7 @@ return {
|
||||
-- lsp
|
||||
{
|
||||
'williamboman/mason.nvim',
|
||||
lazy = true,
|
||||
config = true
|
||||
},
|
||||
{
|
||||
|
@ -7,15 +7,17 @@ return {
|
||||
local telescope = require("telescope.builtin")
|
||||
local wk = require("which-key")
|
||||
wk.add({
|
||||
{ "<leader>gh", telescope.git_bcommits, { noremap = true, silent = true, group = "git", desc = "View commits of current buffer" } },
|
||||
{ "<leader>gb", telescope.git_branches, { noremap = true, silent = true, group = "git", desc = "View git branches" } },
|
||||
{ "<leader>gs", telescope.git_status, { noremap = true, silent = true, group = "git", desc = "View git status" } },
|
||||
{ '<Leader>ff', telescope.git_files, { noremap = true, silent = true, desc = "Search files" } },
|
||||
{ '<Leader>fg', telescope.live_grep, { noremap = true, silent = true, desc = "Search in files" } },
|
||||
{ '<Leader>fb', telescope.buffers, { noremap = true, silent = true, desc = "Search in buffers" } },
|
||||
{ '<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" } },
|
||||
{ "<leader>g", group = "git" },
|
||||
{ "<leader>gh", telescope.git_bcommits, { noremap = true, silent = true }, desc = "View commits of current buffer" },
|
||||
{ "<leader>gb", telescope.git_branches, { noremap = true, silent = true }, desc = "View git branches" },
|
||||
{ "<leader>gs", telescope.git_status, { noremap = true, silent = true }, desc = "View git status" },
|
||||
{ "<leader>f", group = "find" },
|
||||
{ '<Leader>ff', telescope.git_files, { noremap = true, silent = true }, desc = "Search files" },
|
||||
{ '<Leader>fg', telescope.live_grep, { noremap = true, silent = true }, desc = "Search in files" },
|
||||
{ '<Leader>fb', telescope.buffers, { noremap = true, silent = true }, desc = "Search in buffers" },
|
||||
{ '<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
|
||||
},
|
||||
|
@ -5,20 +5,21 @@ return {
|
||||
vim.opt.guifont = 'Source Code Pro for Powerline'
|
||||
vim.cmd('set termguicolors')
|
||||
vim.opt.syntax = 'on'
|
||||
require('kanagawa').setup({
|
||||
colors = {
|
||||
palette = {
|
||||
lotusGray = "#F8F7F4",
|
||||
lotusWhite0 = "#FBFBF9",
|
||||
lotusWhite1 = "#F2F0E9",
|
||||
lotusWhite2 = "#F8F7F2",
|
||||
lotusWhite3 = "#F6F6F1",
|
||||
lotusWhite4 = "#F4F1E6",
|
||||
lotusWhite5 = "#FcFBF9",
|
||||
}
|
||||
}
|
||||
})
|
||||
vim.cmd('colorscheme kanagawa-lotus')
|
||||
-- require('kanagawa').setup({
|
||||
-- colors = {
|
||||
-- palette = {
|
||||
-- lotusGray = "#F8F7F4",
|
||||
-- lotusWhite0 = "#FBFBF9",
|
||||
-- lotusWhite1 = "#F2F0E9",
|
||||
-- lotusWhite2 = "#F8F7F2",
|
||||
-- lotusWhite3 = "#F6F6F1",
|
||||
-- lotusWhite4 = "#F4F1E6",
|
||||
-- lotusWhite5 = "#FcFBF9",
|
||||
-- }
|
||||
-- }
|
||||
-- })
|
||||
-- vim.cmd('colorscheme kanagawa-lotus')
|
||||
vim.cmd('colorscheme kanagawa')
|
||||
end
|
||||
},
|
||||
{ 'lunarvim/lunar.nvim' },
|
||||
@ -37,7 +38,6 @@ return {
|
||||
}
|
||||
}
|
||||
end,
|
||||
dependencies = { 'nvim-treesitter/playground' }
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
@ -92,10 +92,4 @@ return {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
config = true
|
||||
},
|
||||
{
|
||||
'glepnir/dashboard-nvim',
|
||||
event = 'VimEnter',
|
||||
config = true,
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' }
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user