Skip to content

Commit

Permalink
Slimmed down for work purposes.
Browse files Browse the repository at this point in the history
  • Loading branch information
atropos112 committed Apr 14, 2024
1 parent a2904fa commit 4bfcefa
Show file tree
Hide file tree
Showing 16 changed files with 50 additions and 402 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ name: Pre-commit
on:
workflow_dispatch: # allows manual triggering
pull_request:
branches: [main]
branches:
- main
- work
push:
branches:
- main
- work
jobs:
pre-commit:
name: Run pre-commit hooks
Expand Down
5 changes: 5 additions & 0 deletions lua/atro/configs/globals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ g.loaded_netrwPlugin = 1
-- Markdown Preview
g.mkdp_auto_start = 0
g.mkdp_auto_close = 0

-- Work proxy
g.copilot_proxy = "euro-webproxy.drama.man.com:8080"
g.copilot_proxy_strict_ssl = false
vim.cmd([[ autocmd BufNewFile,BufRead *.mb2 set filetype groovy]])
27 changes: 27 additions & 0 deletions lua/atro/configs/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,30 @@ end, { desc = "Diagnostic float" })
-- move lines up and down by 5 lines up and down
set({ "n", "v" }, "<C-j>", "7jzz")
set({ "n", "v" }, "<C-k>", "7kzz")

function ToLink()
local origin = vim.fn.system("git remote -v | grep origin | head -n 1 | awk 'BEGIN{FS=\"/\"} {print $4\"/repos/\"$5}' | sed 's/\\.git (fetch)//'"):gsub("\n", "")
local cmd = "echo " .. vim.fn.expand("%:p") .. " | sed 'sA'$(git rev-parse --show-toplevel)'AbrowseA'"
local path = vim.fn.system(cmd):gsub("\n", "")
local line_num_start, line_num_end
if vim.fn.mode() == "V" then
line_num_start = vim.fn.line("v")
line_num_end = vim.fn.line(".")
if line_num_start > line_num_end then
line_num_start, line_num_end = line_num_end, line_num_start
end
else
line_num_start = vim.api.nvim_win_get_cursor(0)[1]
line_num_end = line_num_start
end
local res = "https://mangit.maninvestments.com/projects/" .. origin .. "/" .. path
if line_num_start == line_num_end then
res = res .. "#" .. line_num_start
else
res = res .. "#" .. line_num_start .. "-" .. line_num_end
end
res = res:gsub("\n", "")
vim.fn.setreg("+", res)
end

set({ "n", "v" }, "<leader>cl", ToLink, { desc = "[C]opy [L]ink to current line(s)" })
41 changes: 0 additions & 41 deletions lua/atro/plugins/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,6 @@ return {
build = "make install_jsregexp",
},

{
"nvimtools/none-ls.nvim",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
-- WARN: In general if possible use lint.lua for linting,
-- fmt.lua for formatting and cmp.lua for autocompletion.
-- Sometimes its not possible or comes with compromises.
-- In such cases use this plugin.
require("atro.utils.mason").install({
"codespell",
"impl",
"gomodifytags",
"staticcheck",
})
local null_ls = require("null-ls")

-- INFO: List of available linters can be found here
-- https://github.com/nvimtools/none-ls.nvim/blob/main/doc/BUILTINS.md
null_ls.setup({
sources = {
null_ls.builtins.diagnostics.codespell,

-- Nix
null_ls.builtins.diagnostics.statix,
null_ls.builtins.diagnostics.deadnix,

-- Go
null_ls.builtins.code_actions.impl,
null_ls.builtins.code_actions.gomodifytags,
null_ls.builtins.diagnostics.staticcheck,
null_ls.builtins.formatting.goimports,

-- Just
null_ls.builtins.formatting.just,
},
})
end,
},
-- Github Copilot
{
"zbirenbaum/copilot.lua",
Expand Down
54 changes: 5 additions & 49 deletions lua/atro/plugins/fmt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,21 @@ return {
require("atro.utils.mason").install({
-- python
"ruff",

-- csharp
"csharpier",

-- json
"fixjson",

-- markdown
"prettier",

-- shell
"shfmt",
"shellharden",

-- yaml
"yamlfmt",

-- toml
"taplo",

-- lua
"stylua",

-- go
"goimports",
})
local conform = require("conform")
conform.formatters.yamlfmt = {
prepend_args = function(_, _)
return {
"-formatter",
-- WARN: This is a custom configuration for yamlfmt. Main concern was it mushing multiline strings into one line. It doesn't do that AS long as there is at MOST one comment line in the multi string. A compromise for sure.
"scan_folded_as_literal=true,retain_line_breaks=true,include_document_start=true",
}
end,
}

-- INFO: List of available linters can be found here
-- https://github.com/stevearc/conform.nvim#formatters
conform.setup({
formatters_by_ft = {
lua = { "stylua" },
python = { "ruff_fix", "ruff_format" },
cs = { "csharpier" },
go = { "gofmt", "goimports" },
json = { "fixjson" },
just = { "just" },
nix = { "alejandra" },
md = { "mdformat" },
sh = { "shfmt", "shellharden" },
yaml = { "yamlfmt" },
toml = { "taplo" },
markdown = { "prettier" },
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
})

require("atro.utils.generic").keyset("n", "<A-s>", function()
require("conform").format()
vim.cmd("w")
end, { desc = "Format and save" })
end,
},
}
42 changes: 0 additions & 42 deletions lua/atro/plugins/lang_specific/csharp.lua

This file was deleted.

47 changes: 0 additions & 47 deletions lua/atro/plugins/lang_specific/go.lua

This file was deleted.

10 changes: 0 additions & 10 deletions lua/atro/plugins/lang_specific/just.lua

This file was deleted.

31 changes: 0 additions & 31 deletions lua/atro/plugins/lang_specific/markdown.lua

This file was deleted.

3 changes: 1 addition & 2 deletions lua/atro/plugins/lang_specific/python.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ return {
"mfussenegger/nvim-dap",
},
config = function()
require("atro.utils.mason").install("debugpy")
local dappy = require("dap-python")
dappy.setup("~/.local/share/nvim/mason/packages/debugpy/venv/bin/python") -- thats where Mason will drop it
dappy.setup("/turbo/jkiedrowski/pyenvs/nvim/bin/python")
dappy.test_runner = "pytest"
end,
},
Expand Down
57 changes: 0 additions & 57 deletions lua/atro/plugins/lang_specific/rust.lua

This file was deleted.

18 changes: 0 additions & 18 deletions lua/atro/plugins/lang_specific/typst.lua

This file was deleted.

Loading

0 comments on commit 4bfcefa

Please sign in to comment.