.config/nvim/lua/plugins/editing.lua

Wed, 27 Dec 2023 01:39:00 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 27 Dec 2023 01:39:00 -0600
changeset 1137
f767f8cd6a9f
parent 1131
f3044a1658fc
child 1141
00240c15eca5
permissions
-rw-r--r--

add asciidoctor and timetrap stubs

1022
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
1 local g = vim.g
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
2
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
3 -- >> Undotree
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
4 g.undotree_SplitWidth = 45
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
5 g.undotree_SetFocusWhenToggle = 1
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
6 g.undotree_ShortIndicators = 1
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
7 g.undotree_DiffCommand = "diff -dp -U 1"
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
8
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
9 -- >> Tagbar
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
10 g.tagbar_autoclose = 1
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
11 g.tagbar_autofocus = 1
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
12 g.tagbar_compact = 1
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
13 g.tagbar_width = 30
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
14
1034
d412eecafebf Add + configure interestingwords
Meredith Howard <mhoward@roomag.org>
parents: 1031
diff changeset
15 -- >> interestingwords
d412eecafebf Add + configure interestingwords
Meredith Howard <mhoward@roomag.org>
parents: 1031
diff changeset
16 -- These are jellybeans colors and some complements
d412eecafebf Add + configure interestingwords
Meredith Howard <mhoward@roomag.org>
parents: 1031
diff changeset
17 g.interestingWordsGUIColors = {
1064
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
18 "#C4A258",
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
19 "#6AADA0",
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
20 "#71B9F8",
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
21 "#A037B0",
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
22 "#CF6A4C",
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
23 "#D8AD4C",
1034
d412eecafebf Add + configure interestingwords
Meredith Howard <mhoward@roomag.org>
parents: 1031
diff changeset
24 }
d412eecafebf Add + configure interestingwords
Meredith Howard <mhoward@roomag.org>
parents: 1031
diff changeset
25 g.interestingWordsTermColors = {
1064
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
26 "179",
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
27 "73",
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
28 "75",
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
29 "133",
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
30 "167",
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
31 "136",
1034
d412eecafebf Add + configure interestingwords
Meredith Howard <mhoward@roomag.org>
parents: 1031
diff changeset
32 }
d412eecafebf Add + configure interestingwords
Meredith Howard <mhoward@roomag.org>
parents: 1031
diff changeset
33
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
34 return {
1068
537a428597b5 tweak lazy loading
Meredith Howard <mhoward@roomag.org>
parents: 1064
diff changeset
35 {
537a428597b5 tweak lazy loading
Meredith Howard <mhoward@roomag.org>
parents: 1064
diff changeset
36 "editorconfig/editorconfig-vim",
537a428597b5 tweak lazy loading
Meredith Howard <mhoward@roomag.org>
parents: 1064
diff changeset
37 event = { "BufReadPost", "BufNewFile" },
1101
40419d8e3cbb cleanup
Meredith Howard <mhoward@roomag.org>
parents: 1100
diff changeset
38 cond = function()
40419d8e3cbb cleanup
Meredith Howard <mhoward@roomag.org>
parents: 1100
diff changeset
39 return vim.fn.has("nvim-0.9") == 0
40419d8e3cbb cleanup
Meredith Howard <mhoward@roomag.org>
parents: 1100
diff changeset
40 end,
1068
537a428597b5 tweak lazy loading
Meredith Howard <mhoward@roomag.org>
parents: 1064
diff changeset
41 },
1022
d509e282ae10 More nvim config
Meredith Howard <mhoward@roomag.org>
parents: 1020
diff changeset
42
1020
b1b644e9825d Add more plain vim plugins
Meredith Howard <mhoward@roomag.org>
parents: 1014
diff changeset
43 "tpope/vim-unimpaired",
b1b644e9825d Add more plain vim plugins
Meredith Howard <mhoward@roomag.org>
parents: 1014
diff changeset
44 "tomtom/tcomment_vim",
1126
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
45
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
46 {
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
47 "windwp/nvim-autopairs",
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
48 event = { "InsertEnter" },
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
49 config = function (_, _)
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
50 local npairs = require("nvim-autopairs")
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
51 npairs.setup({})
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
52 local Rule = require("nvim-autopairs.rule")
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
53
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
54 -- Only run autopairs for opening a multiline block
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
55 npairs.clear_rules()
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
56 for _,bracket in pairs { { '(', ')' }, { '[', ']' }, { '{', '}' } } do
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
57 npairs.add_rules {
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
58 Rule(bracket[1], bracket[2])
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
59 :end_wise(function() return true end)
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
60 }
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
61 end
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
62 end,
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
63 },
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
64
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
65 -- "tpope/vim-endwise",
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
66 -- treesitter-endwise only applies if the parser is installed. do i want to
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
67 -- worry about a fallback?
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
68 {
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
69 "RRethy/nvim-treesitter-endwise",
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
70 config = function (_,_)
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
71 require("nvim-treesitter.configs").setup({
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
72 endwise = { enable = true },
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
73 })
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
74 end,
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
75 },
fe77c5eed375 Add autopairs with cr-only behavior, switch to treesitter-endwise
Meredith Howard <mhoward@roomag.org>
parents: 1101
diff changeset
76
1029
9265f8508e4c Copy other ft and plugin settings
Meredith Howard <mhoward@roomag.org>
parents: 1022
diff changeset
77 "godlygeek/tabular",
1064
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
78 { "mbbill/undotree", cmd = "UndotreeToggle" },
1020
b1b644e9825d Add more plain vim plugins
Meredith Howard <mhoward@roomag.org>
parents: 1014
diff changeset
79
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
80 "tpope/vim-vinegar",
1131
f3044a1658fc nvim: switch to preferring last symver tag / add exceptions
Meredith Howard <mhoward@roomag.org>
parents: 1126
diff changeset
81 { "lfv89/vim-interestingwords", branch = "master" },
1020
b1b644e9825d Add more plain vim plugins
Meredith Howard <mhoward@roomag.org>
parents: 1014
diff changeset
82 "kshenoy/vim-signature",
1064
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
83 { "majutsushi/tagbar", cmd = "TagbarToggle" },
1031
ceb2e56c6e8f Use vim-illuminate
Meredith Howard <mhoward@roomag.org>
parents: 1029
diff changeset
84
ceb2e56c6e8f Use vim-illuminate
Meredith Howard <mhoward@roomag.org>
parents: 1029
diff changeset
85 {
ceb2e56c6e8f Use vim-illuminate
Meredith Howard <mhoward@roomag.org>
parents: 1029
diff changeset
86 "RRethy/vim-illuminate",
1064
fcfa295076a8 Apply stylua
Meredith Howard <mhoward@roomag.org>
parents: 1048
diff changeset
87 event = { "BufReadPost", "BufNewFile" },
1031
ceb2e56c6e8f Use vim-illuminate
Meredith Howard <mhoward@roomag.org>
parents: 1029
diff changeset
88 opts = {
ceb2e56c6e8f Use vim-illuminate
Meredith Howard <mhoward@roomag.org>
parents: 1029
diff changeset
89 delay = 250,
ceb2e56c6e8f Use vim-illuminate
Meredith Howard <mhoward@roomag.org>
parents: 1029
diff changeset
90 large_file_cutoff = 15000,
ceb2e56c6e8f Use vim-illuminate
Meredith Howard <mhoward@roomag.org>
parents: 1029
diff changeset
91 },
ceb2e56c6e8f Use vim-illuminate
Meredith Howard <mhoward@roomag.org>
parents: 1029
diff changeset
92 config = function(_, opts)
ceb2e56c6e8f Use vim-illuminate
Meredith Howard <mhoward@roomag.org>
parents: 1029
diff changeset
93 require("illuminate").configure(opts)
ceb2e56c6e8f Use vim-illuminate
Meredith Howard <mhoward@roomag.org>
parents: 1029
diff changeset
94 end,
ceb2e56c6e8f Use vim-illuminate
Meredith Howard <mhoward@roomag.org>
parents: 1029
diff changeset
95 },
1014
b57969db48db start nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
96 }

mercurial