This repository has no description
4.5 kB
129 lines
1vim.api.nvim_create_user_command("RaiseTmuxPane", function()
2 -- run shell command
3
4 local out = vim.fn.system "tmux list-panes -a -F '#I #{pane_tty}'"
5 local tty = vim.env.TTY
6 if tty == nil then return end
7 local _, _, window_id = string.find(out, "(%d+) " .. tty)
8 if window_id == nil then return end
9 vim.fn.system("tmux select-window -t '" .. window_id .. "'")
10end, {})
11
12vim.api.nvim_create_user_command("Nurl", function()
13 local url = vim.fn.input("Enter a URL: ")
14 local rev = vim.fn.input("Enter the revision (e.g., v0.2.0 or empty string): ")
15
16 local cmd = string.format('nurl %s %s 2>/dev/null', url, rev)
17
18 local output = vim.fn.systemlist(cmd)
19 if vim.v.shell_error == 0 and #output > 0 then
20 vim.api.nvim_put(output, "l", true, true)
21 else
22 print("Error executing command or command returned empty result.")
23 end
24end, {})
25
26return {
27 -- Configure AstroNvim updates
28 updater = {
29 remote = "origin", -- remote to use
30 channel = "stable", -- "stable" or "nightly"
31 version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY)
32 branch = "nightly", -- branch name (NIGHTLY ONLY)
33 commit = nil, -- commit hash (NIGHTLY ONLY)
34 pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only)
35 skip_prompts = false, -- skip prompts about breaking changes
36 show_changelog = true, -- show the changelog after performing an update
37 auto_quit = false, -- automatically quit the current session after a successful update
38 remotes = { -- easily add new remotes to track
39 -- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url
40 -- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut,
41 -- ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork
42 },
43 },
44 -- Set colorscheme to use
45 colorscheme = "gruvbox",
46 -- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
47 diagnostics = {
48 virtual_text = true,
49 underline = true,
50 },
51 lsp = {
52 config = {
53 clangd = {
54 cmd = { "clangd", "--offset-encoding=utf-16" },
55 },
56 vale = {
57 cmd = { "vale", "--lsp" },
58 filetypes = { "markdown", "text" },
59 },
60 },
61 -- customize lsp formatting options
62 formatting = {
63 -- control auto formatting on save
64 format_on_save = {
65 enabled = true, -- enable or disable format on save globally
66 allow_filetypes = { -- enable format on save for specified filetypes only
67 "go",
68 },
69 ignore_filetypes = { -- disable format on save for specified filetypes
70 -- "python",
71 },
72 },
73 disabled = { -- disable formatting capabilities for the listed language servers
74 -- disable lua_ls formatting capability if you want to use StyLua to format your lua code
75 -- "lua_ls",
76 },
77 timeout_ms = 1000, -- default format timeout
78 -- filter = function(client) -- fully override the default formatting function
79 -- return true
80 -- end
81 },
82 -- enable servers that you already have installed without mason
83 servers = {
84 "clangd",
85 "bashls",
86 "gopls",
87 "taplo",
88 "marksman",
89 "pyright",
90 "nil_ls",
91 "terraformls",
92 "lua_ls",
93 "vale",
94 "rust_analyzer",
95 "gopls",
96 "yamlls",
97 "denols",
98 },
99 },
100 -- Configure require("lazy").setup() options
101 lazy = {
102 defaults = { lazy = true },
103 -- Disable change detection because it caused nvim to constantly need 3-5% CPU, which is bad for battery life
104 change_detection = { enabled = false, },
105 performance = {
106 rtp = {
107 -- customize default disabled vim plugins
108 disabled_plugins = { "tohtml", "gzip", "matchit", "zipPlugin", "netrwPlugin", "tarPlugin" },
109 },
110 },
111 },
112 -- This function is run last and is a good place to configuring
113 -- augroups/autocommands and custom filetypes also this just pure lua so
114 -- anything that doesn't fit in the normal config locations above can go here
115 polish = function()
116 -- Set up custom filetypes
117 -- vim.filetype.add {
118 -- extension = {
119 -- foo = "fooscript",
120 -- },
121 -- filename = {
122 -- ["Foofile"] = "fooscript",
123 -- },
124 -- pattern = {
125 -- ["~/%.config/foo/.*"] = "fooscript",
126 -- },
127 -- }
128 end,
129}