Browse Source

Add undotree and fix lualine stuff

master
parent
commit
1eb361de31
5 changed files with 36 additions and 8 deletions
  1. +2
    -1
      .config/nvim/lazy-lock.json
  2. +2
    -4
      .config/nvim/lua/tovi/plugins/formatting.lua
  3. +11
    -2
      .config/nvim/lua/tovi/plugins/lualine.lua
  4. +20
    -0
      .config/nvim/lua/tovi/plugins/telescope.lua
  5. +1
    -1
      .config/nvim/lua/tovi/plugins/undotree.lua

+ 2
- 1
.config/nvim/lazy-lock.json View File

@ -41,8 +41,9 @@
"oil.nvim": { "branch": "master", "commit": "3727410e4875ad8ba339c585859a9391d643b9ed" }, "oil.nvim": { "branch": "master", "commit": "3727410e4875ad8ba339c585859a9391d643b9ed" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
"telescope-undo.nvim": { "branch": "main", "commit": "a3dcb6e32a3a59a5570a7cda33171eeef9753345" },
"telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, "telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
"undotree": { "branch": "master", "commit": "170aa9e516b6926e6bddfe21bbf01f2283a00e7d" },
"undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" },
"vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" }, "vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" },
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" } "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }
} }

+ 2
- 4
.config/nvim/lua/tovi/plugins/formatting.lua View File

@ -18,8 +18,6 @@ return {
rust = { "rustfmt" }, rust = { "rustfmt" },
shell = { "shfmt", "shellcheck" }, shell = { "shfmt", "shellcheck" },
python = { "isort", "black" }, python = { "isort", "black" },
["*"] = { "codespell" },
["_"] = { "trim_whitespace" },
}, },
format_on_save = { format_on_save = {
lsp_fallback = true, lsp_fallback = true,
@ -29,8 +27,8 @@ return {
format_after_save = { format_after_save = {
lsp_fallback = true, lsp_fallback = true,
}, },
log_level = vim.log.levels.ERROR,
notify_on_error = true,
log_level = vim.log.levels.WARN,
notify_on_error = false,
}) })
vim.keymap.set({ "n", "v" }, "<leader>ff", function() vim.keymap.set({ "n", "v" }, "<leader>ff", function()


+ 11
- 2
.config/nvim/lua/tovi/plugins/lualine.lua View File

@ -3,7 +3,7 @@ return {
dependencies = { "nvim-tree/nvim-web-devicons" }, dependencies = { "nvim-tree/nvim-web-devicons" },
config = function() config = function()
local lualine = require("lualine") local lualine = require("lualine")
local lazy_status = require("lazy.status") -- to configure lazy pending updates count
local lazy_status = require("lazy.status")
local colors = { local colors = {
blue = "#65D1FF", blue = "#65D1FF",
@ -53,15 +53,24 @@ return {
lualine.setup({ lualine.setup({
options = { options = {
theme = my_lualine_theme, theme = my_lualine_theme,
section_separators = { left = "", right = "" },
component_separators = { left = "|", right = "|" },
}, },
sections = { sections = {
lualine_b = {
{ "diagnostics" },
{ "branch" },
{ "diff" },
},
lualine_c = {
{ "filename", file_status = true, path = 1 },
},
lualine_x = { lualine_x = {
{ {
lazy_status.updates, lazy_status.updates,
cond = lazy_status.has_updates, cond = lazy_status.has_updates,
color = { fg = "#ff9e64" }, color = { fg = "#ff9e64" },
}, },
{ "encoding" },
{ "fileformat" }, { "fileformat" },
{ "filetype" }, { "filetype" },
}, },


+ 20
- 0
.config/nvim/lua/tovi/plugins/telescope.lua View File

@ -5,6 +5,7 @@ return {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, { "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",
"debugloop/telescope-undo.nvim",
}, },
config = function() config = function()
local telescope = require("telescope") local telescope = require("telescope")
@ -68,9 +69,26 @@ return {
}, },
}, },
}, },
extensions = {
undo = {
side_by_side = true,
mappings = {
i = {
["<CR>"] = require("telescope-undo.actions").restore,
},
n = {
["<CR>"] = require("telescope-undo.actions").restore,
["y"] = require("telescope-undo.actions").yank_additions,
["Y"] = require("telescope-undo.actions").yank_deletions,
["u"] = require("telescope-undo.actions").restore,
},
},
},
},
}) })
telescope.load_extension("fzf") telescope.load_extension("fzf")
telescope.load_extension("undo")
local git_branches = function() local git_branches = function()
builtin.git_branches({ builtin.git_branches({
@ -113,5 +131,7 @@ return {
hidden = true, hidden = true,
}) })
end, { desc = "Find neovim config files" }) end, { desc = "Find neovim config files" })
vim.keymap.set("n", "<leader>u", "<cmd>Telescope undo<cr>")
end, end,
} }

+ 1
- 1
.config/nvim/lua/tovi/plugins/undotree.lua View File

@ -1,6 +1,6 @@
return { return {
"mbbill/undotree", "mbbill/undotree",
config = function() config = function()
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
-- vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
end, end,
} }

Loading…
Cancel
Save