Skip to content

Commit ab395cc

Browse files
committed
Still shuffling neovim config around
1 parent 0c6a856 commit ab395cc

10 files changed

Lines changed: 52 additions & 46 deletions

File tree

.nvim.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ local lspconfig = require("lspconfig")
44
local capabilities = require("cmp_nvim_lsp").default_capabilities()
55

66
-- See https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#lua_ls
7+
--
8+
-- This overrides what's in the .laurc.json file, and extends it with Neovim's
9+
-- library directories for better completion and hover docs.
710
local lua_settings = {
811
Lua = {
912
runtime = {

config/nvim/lazy-lock.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"file-line": { "branch": "main", "commit": "559088afaf10124ea663ee0f4f73b1de48fb1632" },
1111
"friendly-snippets": { "branch": "main", "commit": "e11b09bf10706bb74e16e4c3d11b2274d62e687f" },
1212
"gitsigns.nvim": { "branch": "main", "commit": "4a143f13e122ab91abdc88f89eefbe70a4858a56" },
13-
"lazy.nvim": { "branch": "main", "commit": "fafe1f7c640aed75e70a10e6649612cd96f39149" },
13+
"lazy.nvim": { "branch": "main", "commit": "eb4957442e3182f051b0ae11da32e06d22c190e3" },
1414
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
1515
"mason-lspconfig.nvim": { "branch": "main", "commit": "8db12610bcb7ce67013cfdfaba4dd47a23c6e851" },
1616
"mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" },
@@ -19,20 +19,20 @@
1919
"nightfox.nvim": { "branch": "main", "commit": "df75a6a94910ae47854341d6b5a6fd483192c0eb" },
2020
"none-ls.nvim": { "branch": "main", "commit": "8691504118b252d64fc5023a104aedd100ab754a" },
2121
"nui.nvim": { "branch": "main", "commit": "322978c734866996274467de084a95e4f9b5e0b1" },
22-
"nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
22+
"nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" },
2323
"nvim-lsp-file-operations": { "branch": "master", "commit": "223aca86b737dc66e9c51ebcda8788a8d9cc6cf2" },
2424
"nvim-lspconfig": { "branch": "master", "commit": "92166b89ab4b3d60f24e58170cac53b7141fd032" },
2525
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
26-
"nvim-surround": { "branch": "main", "commit": "ae876ab0f8d41213131c3ed4eeb4c48328f45e12" },
27-
"nvim-treesitter": { "branch": "master", "commit": "c5cbd3ec74f6f5ddbac939e6f24b99fe78262b4c" },
26+
"nvim-surround": { "branch": "main", "commit": "687ea2f33955df0042bf228853a82696265e7e2d" },
27+
"nvim-treesitter": { "branch": "master", "commit": "9ebc589329083522f9594f408fc2652090b41139" },
2828
"nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" },
2929
"nvim-ts-autotag": { "branch": "main", "commit": "6eb4120a1aadef07ac312f1c4bc6456712220007" },
30-
"nvim-web-devicons": { "branch": "master", "commit": "b4b302d6ae229f67df7a87ef69fa79473fe788a9" },
30+
"nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" },
3131
"nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" },
3232
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
3333
"refactoring.nvim": { "branch": "master", "commit": "d2786877c91aa409c824f27b4ce8a9f560dda60a" },
3434
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
35-
"telescope.nvim": { "branch": "master", "commit": "dfa230be84a044e7f546a6c2b0a403c739732b86" },
35+
"telescope.nvim": { "branch": "master", "commit": "3a743491e5c6be0ed0aa8c31c6905df8f66179ba" },
3636
"treesj": { "branch": "main", "commit": "f98deb33805485b56a8d44d1a27d16874af00d7f" },
3737
"vim-rails": { "branch": "master", "commit": "8972461e64c7c4bf049f2f86ea1bc571e8077b55" },
3838
"vim-slim": { "branch": "master", "commit": "a0a57f75f20a03d5fa798484743e98f4af623926" },

config/nvim/lua/actions.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ local neo_tree = require("neo-tree.command")
33
local telescope = require("telescope.builtin")
44

55
return {
6+
browse_on_github = function()
7+
vim.cmd("silent !gh browse")
8+
end,
9+
610
choose_git_base = function()
711
local callback = function(git_base)
812
if git_base ~= nil then
@@ -29,7 +33,7 @@ return {
2933
-- Neo-tree buffers don't restore correctly, so close it first.
3034
neo_tree.execute({ action = "close" })
3135
vim.cmd.wall()
32-
vim.cmd("mksession!")
36+
vim.cmd.mksession({ bang = true })
3337
vim.cmd.quit()
3438
end,
3539

config/nvim/lua/key-mappings.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ local function map_global_keys()
4141

4242
which_key.register({ ["<leader>g"] = { name = "git" } })
4343
map("", "<leader>gb", gitsigns.blame_line, { desc = "git blame" })
44-
map("", "<leader>gp", gitsigns.preview_hunk_inline, { desc = "preview hunk" })
4544
map("", "<leader>gc", actions.choose_git_base, { desc = "change git base" })
45+
map("", "<leader>gh", actions.browse_on_github, { desc = "browse on github" })
46+
map("", "<leader>gp", gitsigns.preview_hunk_inline, { desc = "preview hunk" })
4647

4748
which_key.register({ ["<leader>t"] = { name = "telescope" } })
4849
map("", "<leader>t.", telescope.resume, { desc = "repeat last find" })
@@ -89,7 +90,6 @@ local function map_lsp_keys(args)
8990
map("", "<leader>ca", vim.lsp.buf.code_action, { buffer = buffer, desc = "code actions" })
9091
map("", "<leader>cr", vim.lsp.buf.rename, { buffer = buffer, desc = "rename symbol under cursor" })
9192

92-
map("", "<leader>td", telescope.diagnostics, { buffer = buffer, desc = "find diagnostics" })
9393
map("", "<leader>ts", telescope.lsp_document_symbols, { buffer = buffer, desc = "find document symbols" })
9494
end
9595

config/nvim/lua/plugins/editing.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,10 @@ return {
1515

1616
-- https://github.com/kylechui/nvim-surround
1717
{ "kylechui/nvim-surround", config = true },
18+
19+
-- https://github.com/tpope/vim-rails
20+
"tpope/vim-rails",
21+
22+
-- https://github.com/slim-template/vim-slim
23+
"slim-template/vim-slim",
1824
}

config/nvim/lua/plugins/languages.lua

Lines changed: 0 additions & 6 deletions
This file was deleted.

config/nvim/lua/plugins/lsp/lspconfig-config.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ return function()
22
local lspconfig = require("lspconfig")
33
local capabilities = require("cmp_nvim_lsp").default_capabilities()
44

5-
if os.getenv("DOTFILES_ENV") == "home" then
5+
local dotfiles_env = os.getenv("DOTFILES_ENV")
6+
7+
if dotfiles_env == "home" then
68
lspconfig.bashls.setup({ capabilities = capabilities })
79
lspconfig.eslint.setup({ capabilities = capabilities })
810
lspconfig.solargraph.setup({ capabilities = capabilities })
911
lspconfig.standardrb.setup({ capabilities = capabilities })
1012
lspconfig.tsserver.setup({ capabilities = capabilities })
1113
end
1214

13-
if os.getenv("DOTFILES_ENV") == "work" then
15+
if dotfiles_env == "work" then
1416
lspconfig.bashls.setup({ capabilities = capabilities })
1517
lspconfig.eslint.setup({ capabilities = capabilities })
1618
lspconfig.relay_lsp.setup({ capabilities = capabilities })

config/nvim/lua/plugins/lsp/null-ls-config.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ return function()
33
local formatting = null_ls.builtins.formatting
44

55
local sources = {}
6+
local dotfiles_env = os.getenv("DOTFILES_ENV")
67

7-
if os.getenv("DOTFILES_ENV") == "home" then
8+
if dotfiles_env == "home" then
89
sources = {
910
formatting.prettierd.with({
1011
disabled_filetypes = { "ruby" },
@@ -13,7 +14,7 @@ return function()
1314
}
1415
end
1516

16-
if os.getenv("DOTFILES_ENV") == "work" then
17+
if dotfiles_env == "work" then
1718
sources = {
1819
formatting.prettierd.with({
1920
disabled_filetypes = { "yaml" },
Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,4 @@ local neo_tree_file_operations_spec = {
4949
dependencies = { "nvim-lua/plenary.nvim", neo_tree_spec },
5050
}
5151

52-
-- telescope does fuzzy finding over all sorts of things.
53-
local telescope_spec = {
54-
-- https://github.com/nvim-telescope/telescope.nvim
55-
"nvim-telescope/telescope.nvim",
56-
dependencies = {
57-
"nvim-lua/plenary.nvim",
58-
"nvim-tree/nvim-web-devicons",
59-
"nvim-telescope/telescope-ui-select.nvim",
60-
},
61-
config = function()
62-
local telescope = require("telescope")
63-
telescope.setup({
64-
defaults = { layout_strategy = "vertical" },
65-
extensions = {
66-
["ui-select"] = {
67-
require("telescope.themes").get_dropdown(),
68-
},
69-
},
70-
})
71-
require("telescope").load_extension("ui-select")
72-
end,
73-
}
74-
75-
return {
76-
neo_tree_file_operations_spec,
77-
telescope_spec,
78-
}
52+
return { neo_tree_file_operations_spec }
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
-- telescope does fuzzy finding over all sorts of things.
2+
return {
3+
-- https://github.com/nvim-telescope/telescope.nvim
4+
"nvim-telescope/telescope.nvim",
5+
dependencies = {
6+
"nvim-lua/plenary.nvim",
7+
"nvim-tree/nvim-web-devicons",
8+
"nvim-telescope/telescope-ui-select.nvim",
9+
},
10+
config = function()
11+
local telescope = require("telescope")
12+
telescope.setup({
13+
defaults = { layout_strategy = "vertical" },
14+
extensions = {
15+
["ui-select"] = {
16+
require("telescope.themes").get_dropdown(),
17+
},
18+
},
19+
})
20+
require("telescope").load_extension("ui-select")
21+
end,
22+
}

0 commit comments

Comments
 (0)