.config/nvim/lua/plugins/ui.lua

Wed, 25 Sep 2024 15:03:13 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 25 Sep 2024 15:03:13 -0500
changeset 1179
b0a0ba3240b5
parent 1176
1cb4636d6d36
permissions
-rw-r--r--

No LSP autostart when read-only

I think nvim actually threw out 'view' argc detection, I just use -R and alias
view to it.

1022
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
1 local g = vim.g
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
2
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
3 -- >> Viewdoc
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
4 g.no_viewdoc_abbrev = 1
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
5 g.viewdoc_open = "topleft new"
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
6 g.viewdoc_winwidth_max = 100
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
7
1116
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
8 g.neo_tree_remove_legacy_commands = 1
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
9
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10 return {
1068
537a428597b5 tweak lazy loading
Meredith Howard <mhoward@roomag.org>
parents: 1064
diff changeset
11 { "powerman/vim-plugin-viewdoc", event = "VeryLazy" },
1022
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
12
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 {
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14 "nvim-lualine/lualine.nvim",
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15 opts = {
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
16 options = {
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
17 theme = "auto",
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
18 icons_enabled = false,
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
19 section_separators = "",
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
20 component_separators = "",
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
21 },
1045
456c039881a8 tweak status lines
Meredith Howard <mhoward@roomag.org>
parents: 1022
diff changeset
22 sections = {
1064
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1045
diff changeset
23 lualine_a = { "mode" },
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1045
diff changeset
24 lualine_b = { "filename" },
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1045
diff changeset
25 lualine_c = { "diagnostics" },
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1045
diff changeset
26 lualine_x = { "encoding", "fileformat" },
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1045
diff changeset
27 lualine_y = { "filetype" },
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1045
diff changeset
28 lualine_z = { "progress", "location" },
1045
456c039881a8 tweak status lines
Meredith Howard <mhoward@roomag.org>
parents: 1022
diff changeset
29 },
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
30 tabline = {
1064
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1045
diff changeset
31 lualine_a = { { "buffers", mode = 4, show_filename_only = false } },
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1045
diff changeset
32 lualine_z = { "branch" },
1015
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1014
diff changeset
33 },
1064
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1045
diff changeset
34 extensions = { "quickfix" },
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1045
diff changeset
35 },
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
36 },
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
37
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
38 {
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
39 "lukas-reineke/indent-blankline.nvim",
1130
91a00bcc28f9 Update for indent-blankline 3.x
Meredith Howard <mhoward@roomag.org>
parents: 1124
diff changeset
40 main = "ibl",
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
41 keys = {
1175
7907b9c30399 Add which-key.nvim and descriptions
Meredith Howard <mhoward@roomag.org>
parents: 1147
diff changeset
42 { "<leader>ig", "<cmd>IBLToggle<cr>", desc = "Toggle Indent Guides" },
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
43 },
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
44 opts = {
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
45 enabled = false,
1130
91a00bcc28f9 Update for indent-blankline 3.x
Meredith Howard <mhoward@roomag.org>
parents: 1124
diff changeset
46 indent = { char = "│" },
91a00bcc28f9 Update for indent-blankline 3.x
Meredith Howard <mhoward@roomag.org>
parents: 1124
diff changeset
47 whitespace = { remove_blankline_trail = true },
91a00bcc28f9 Update for indent-blankline 3.x
Meredith Howard <mhoward@roomag.org>
parents: 1124
diff changeset
48 scope = { enabled = false },
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
49 },
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
50 },
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
51
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
52 {
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
53 "echasnovski/mini.indentscope",
1147
23f9b157fe8a Load indentscope even on new nameless bufs
Meredith Howard <mhoward@roomag.org>
parents: 1131
diff changeset
54 event = "VeryLazy",
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
55 opts = {
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
56 symbol = "│",
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
57 options = { try_as_border = true },
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
58 draw = {
1064
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1045
diff changeset
59 animation = function()
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1045
diff changeset
60 return 2
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1045
diff changeset
61 end,
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
62 },
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
63 },
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
64 config = function(_, opts)
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
65 vim.api.nvim_create_autocmd("FileType", {
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
66 pattern = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" },
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
67 callback = function()
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
68 vim.b.miniindentscope_disable = true
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
69 end,
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
70 })
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
71 require("mini.indentscope").setup(opts)
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
72 end,
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
73 },
1175
7907b9c30399 Add which-key.nvim and descriptions
Meredith Howard <mhoward@roomag.org>
parents: 1147
diff changeset
74
1116
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
75 {
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
76 "nvim-neo-tree/neo-tree.nvim",
1124
cb981f8aba50 neotree v3.x
Meredith Howard <mhoward@roomag.org>
parents: 1116
diff changeset
77 branch = "v3.x",
1116
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
78 cmd = "Neotree",
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
79 dependencies = {
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
80 "nvim-lua/plenary.nvim",
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
81 "MunifTanjim/nui.nvim",
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
82 {
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
83 "s1n7ax/nvim-window-picker",
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
84 config = function(_, _)
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
85 local theme = require("kanagawa.colors").setup().theme
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
86 require("window-picker").setup({
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
87 use_winbar = "always",
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
88 fg_color = theme.ui.fg_reverse,
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
89 current_win_hl_color = theme.syn.constant,
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
90 other_win_hl_color = theme.syn.fun,
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
91 })
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
92 end,
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
93 },
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
94 },
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
95 opts = {
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
96 enable_git_status = false,
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
97 window = { mappings = { ["<F2>"] = "close_window" } },
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
98 filesystem = { hijack_netrw_behavior = "disabled" },
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
99 default_component_configs = {
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
100 icon = {
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
101 folder_closed = "▷",
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
102 folder_open = "▽",
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
103 folder_empty = "¤",
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
104 default = "•",
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
105 },
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
106 },
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
107 },
2d8f07b212e9 add neo-tree
Meredith Howard <mhoward@roomag.org>
parents: 1081
diff changeset
108 },
1175
7907b9c30399 Add which-key.nvim and descriptions
Meredith Howard <mhoward@roomag.org>
parents: 1147
diff changeset
109
7907b9c30399 Add which-key.nvim and descriptions
Meredith Howard <mhoward@roomag.org>
parents: 1147
diff changeset
110 {
7907b9c30399 Add which-key.nvim and descriptions
Meredith Howard <mhoward@roomag.org>
parents: 1147
diff changeset
111 "folke/which-key.nvim",
7907b9c30399 Add which-key.nvim and descriptions
Meredith Howard <mhoward@roomag.org>
parents: 1147
diff changeset
112 opts = {
7907b9c30399 Add which-key.nvim and descriptions
Meredith Howard <mhoward@roomag.org>
parents: 1147
diff changeset
113 preset = "helix",
7907b9c30399 Add which-key.nvim and descriptions
Meredith Howard <mhoward@roomag.org>
parents: 1147
diff changeset
114 delay = 500,
7907b9c30399 Add which-key.nvim and descriptions
Meredith Howard <mhoward@roomag.org>
parents: 1147
diff changeset
115 filter = function(m) return m.desc ~= "" end,
7907b9c30399 Add which-key.nvim and descriptions
Meredith Howard <mhoward@roomag.org>
parents: 1147
diff changeset
116 icons = { rules = false },
1176
1cb4636d6d36 Fix for no-nerdfonts experience
Meredith Howard <mhoward@roomag.org>
parents: 1175
diff changeset
117 replace = { key = {} },
1175
7907b9c30399 Add which-key.nvim and descriptions
Meredith Howard <mhoward@roomag.org>
parents: 1147
diff changeset
118 },
7907b9c30399 Add which-key.nvim and descriptions
Meredith Howard <mhoward@roomag.org>
parents: 1147
diff changeset
119 },
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
120 }

mercurial