Skip to content

Commit

Permalink
[neovim] Minor fixes to get to parity with nvim.bak
Browse files Browse the repository at this point in the history
  • Loading branch information
sidneyw committed Nov 20, 2023
1 parent dfb4ddd commit 642c436
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 76 deletions.
38 changes: 7 additions & 31 deletions config/alacritty/alacritty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,8 @@ import:
- ~/.config/alacritty/themes/themes/tomorrow_night.yaml

hints:
# Keys used for the hint labels.
alphabet: "jfkdls;ahgurieowpq"

# List with all available hints
#
# Each hint must have any of `regex` or `hyperlinks` field and either an
# `action` or a `command` field. The fields `mouse`, `binding` and
# `post_processing` are optional.
#
# The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be
# highlighted.
#
# The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and
# `mouse.mods` accept the same values as they do in the `key_bindings` section.
#
# The `mouse.enabled` field controls if the hint should be underlined while
# the mouse with all `mouse.mods` keys held or the vi mode cursor is above it.
#
# If the `post_processing` field is set to `true`, heuristics will be used to
# shorten the match if there are characters likely not to be part of the hint
# (e.g. a trailing `.`). This is most useful for URIs and applies only to
# `regex` matches.
#
# Values for `action`:
# - Copy
# Copy the hint's text to the clipboard.
# - Paste
# Paste the hint's text to the terminal or search.
# - Select
# Select the hint's text.
# - MoveViModeCursor
# Move the vi mode cursor to the beginning of the hint.
enabled:
- regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\
[^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+"
Expand All @@ -71,7 +41,13 @@ hints:
mods: None
binding:
key: U
mods: Control|Shift
mods: Command|Shift

key_bindings:
# Necessary for C-^ to work in neovim
- { key: Key6, mods: Control, chars: "\x1e" }


# Configuration for Alacritty, the GPU enhanced terminal emulator.

# Import additional configuration files
Expand Down
30 changes: 18 additions & 12 deletions config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LazyVim": { "branch": "main", "commit": "68ff818a5bb7549f90b05e412b76fe448f605ffb" },
"LuaSnip": { "branch": "master", "commit": "1f4ad8bb72bdeb60975e98652636b991a9b7475d" },
"SchemaStore.nvim": { "branch": "main", "commit": "9fb873af43568464f9a1936fc334dfa3d7a59418" },
"LuaSnip": { "branch": "master", "commit": "cab667e2674881001a86a7478fff7dc7791c63f5" },
"SchemaStore.nvim": { "branch": "main", "commit": "303118cd18eccbdfb7393a9ef1ed9465dd140c09" },
"catppuccin": { "branch": "main", "commit": "a8dfb969e76d1a0752d98b5347be9ffb9bca9592" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "a36c68d2cd551e49883ddb2492c178d915567f58" },
"conform.nvim": { "branch": "master", "commit": "2e5866a2c412a1237a9796a2d5a62d07fe084cc5" },
"copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" },
"copilot.lua": { "branch": "master", "commit": "73047082d72fcfdde1f73b7f17ad495cffcbafaa" },
"dashboard-nvim": { "branch": "master", "commit": "63df28409d940f9cac0a925df09d3dc369db9841" },
"diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
"dressing.nvim": { "branch": "master", "commit": "fe3071330a0720ce3695ac915820c8134b22d1b0" },
"flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
"friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
"gitsigns.nvim": { "branch": "main", "commit": "0ccd5fb2316b3f8d8b2f775bc31cae7bc6a77a55" },
"go.nvim": { "branch": "master", "commit": "e749ff85ffec5a4ef11cb8252a2030be5726cb6c" },
Expand All @@ -28,31 +29,31 @@
"mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" },
"mini.ai": { "branch": "main", "commit": "4a2e387b121352dfb478f440c9a5313a9d97006c" },
"mini.bufremove": { "branch": "main", "commit": "f53c7f27e36009fe61563c11cde154b94a0e5b94" },
"mini.comment": { "branch": "main", "commit": "3d9c8009615857e982f09bc5357fc95f2a2175f3" },
"mini.indentscope": { "branch": "main", "commit": "c8fdafa7bf603d758986a27eb546c55a5c73b1a3" },
"mini.pairs": { "branch": "main", "commit": "71f117fd57f930da6ef4126b24f594dd398bac26" },
"mini.surround": { "branch": "main", "commit": "af8129efcabe95fc08a233e9f91569829bed031f" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "230ff118613fa07138ba579b89d13ec2201530b9" },
"neoconf.nvim": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" },
"neodev.nvim": { "branch": "main", "commit": "627b5b543f4df551fcddb99c17a8e260c453400d" },
"noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" },
"nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" },
"nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" },
"nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" },
"nvim-dap": { "branch": "master", "commit": "e154fdb6d70b3765d71f296e718b29d8b7026a63" },
"nvim-dap-python": { "branch": "master", "commit": "e0be843877e7ae756ef1ee7a441ca0b9e1677da9" },
"nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "57f1dbd0458dd84a286b27768c142e1567f3ce3b" },
"nvim-lint": { "branch": "master", "commit": "3a7c15331a57ba40a56f00f29173700af853fa03" },
"nvim-lspconfig": { "branch": "master", "commit": "6516abf5ac7d017480c8c8e08c0d24066bcb8d43" },
"nvim-lspconfig": { "branch": "master", "commit": "7fedba8b1f8d0080c775851c429b88fd2ed4c6f5" },
"nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" },
"nvim-spectre": { "branch": "master", "commit": "a18a58015b46f02b4fe537ebfffd82e46110ff24" },
"nvim-treesitter": { "branch": "master", "commit": "d87629647614b779fb2aad8f0042fe2864253ea6" },
"nvim-treesitter-context": { "branch": "master", "commit": "f3ec0d8a1b4e07d7ed2da6b9a9f10864a83c4be4" },
"nvim-treesitter": { "branch": "master", "commit": "1610b1aafb9b7b3a7b54c853ed45c6cb1a3d0df2" },
"nvim-treesitter-context": { "branch": "master", "commit": "ec7f160375226d90f16a019d175be730e4ac456b" },
"nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "dbcd9388e3b119a87c785e10a00d62876077d23d" },
"nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "ead792ccdace6a9d64a8119909af243ed0105465" },
"nvim-web-devicons": { "branch": "master", "commit": "d3cf19ef81d364af2af527d6a23ad201330ccfad" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "bdd2a3293340465a516b126d10894f6d5cb5213c" },
"nvim-web-devicons": { "branch": "master", "commit": "cdbcca210cf3655aa9b31ebf2422763ecd85ee5c" },
"persistence.nvim": { "branch": "main", "commit": "ad538bfd5336f1335cdb6fd4e0b0eebfa6e12f32" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
"tabline.nvim": { "branch": "main", "commit": "ff33d12a20d52daafa5393162cae4108faf8128b" },
Expand All @@ -68,9 +69,14 @@
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
"typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" },
"venv-selector.nvim": { "branch": "main", "commit": "c259dacb20a00fb84ec6006e9a24b4085b27120a" },
"vim-dispatch": { "branch": "master", "commit": "6cc2691576f97d43f8751664d1a1a908b99927e5" },
"vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" },
"vim-helm": { "branch": "master", "commit": "c2e7b85711d410e1d73e64eb5df7b70b1c4c10eb" },
"vim-highlightedyank": { "branch": "master", "commit": "fa3f57b097e9521ce41a66b6c7cf5d9adea70ea3" },
"vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" },
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
"vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" },
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
}
2 changes: 2 additions & 0 deletions config/nvim/lua/config/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ vim.cmd([[
nnoremap <leader>lb :Make! lint-branch<cr>
nnoremap <leader>cl :!cpsha<cr>
nnoremap <C-^> :b# <CR>
]])

vim.cmd([[
Expand Down
24 changes: 17 additions & 7 deletions config/nvim/lua/plugins/cmp.lua
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
-- Set up nvim-cmp.
local cmp = require("cmp")
local luasnip = require("luasnip")

require("luasnip.loaders.from_snipmate").load()
require("luasnip.loaders.from_vscode").load()

local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end

return {
{
"L3MON4D3/LuaSnip",
keys = function()
return {}
end,
},
{
"hrsh7th/nvim-cmp",
opts = function(_, opts)
local cmp = require("cmp")
local luasnip = require("luasnip")

opts.window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
}

opts.mapping = cmp.mapping.preset.insert({
opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<C-k>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
Expand Down Expand Up @@ -63,4 +66,11 @@ return {
})
end,
},
{
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_snipmate").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
}
7 changes: 7 additions & 0 deletions config/nvim/lua/plugins/disabled.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
return {
-- bufferline
{ "akinsho/bufferline.nvim", enabled = false },
-- TODO: Try out mini plugins
{ "echasnovski/mini.surround", enabled = false },
{ "echasnovski/mini.pairs", enabled = false },
{ "echasnovski/mini.comment", enabled = false },
-- Disable the default keymap for flash
-- TODO: Figure out if I'm keeping flash or removing it entirely
{ "folke/flash.nvim", enabled = false },
}
51 changes: 39 additions & 12 deletions config/nvim/lua/plugins/editor.lua
Original file line number Diff line number Diff line change
@@ -1,23 +1,50 @@
return {
{
"nvim-neo-tree/neo-tree.nvim",
-- add keybindings
keys = {
{
"<C-n>",
function()
require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() })
end,
desc = "Toggle Neotree (CWD)",
},
},
-- Replace the default keymaps
keys = function()
return {
{
"<C-n>",
function()
require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() })
end,
desc = "Toggle Neotree (CWD)",
},
}
end,
},
{ "towolf/vim-helm" },
-- tree-sitter ensure installed
{
-- tree-sitter ensure installed
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
opts.ensure_installed = "all"
end,
},
{ "nvim-treesitter/playground" },
{ "nvim-treesitter/nvim-treesitter-refactor" },
{ "towolf/vim-helm" },
-- TPope Plugins
{ "tpope/vim-dispatch" },
{ "tpope/vim-repeat" },
{ "tpope/vim-rhubarb" },
{ "tpope/vim-unimpaired", enabled = false },
{ "tpope/vim-surround" },
{
"machakann/vim-highlightedyank",
config = function()
vim.g.highlightedyank_highlight_duration = 200
end,
},
{
"windwp/nvim-autopairs",
opts = {
disable_filetype = { "TelescopePrompt", "guihua", "guihua_rust", "clap_input" },
},
config = true,
},
{
"numToStr/Comment.nvim",
config = true,
},
}
1 change: 1 addition & 0 deletions config/nvim/lua/plugins/git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ return {
]])
end,
},
{ "sindrets/diffview.nvim" },
}
9 changes: 4 additions & 5 deletions config/nvim/lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,10 @@ return {
},
{
"simrat39/symbols-outline.nvim",
keys = {
["<C-\\>"] = "<cmd>SymbolsOutline<CR>",
},
init = function()
vim.keymap.set("n", "<C-\\>", "<cmd>SymbolsOutline<CR>", { noremap = true, silent = true })
keys = function()
return {
{ "<C-\\>", "<cmd>SymbolsOutline<CR>", desc = "Symbols Outline" },
}
end,
config = true,
cmd = { "SymbolsOutline" },
Expand Down
18 changes: 9 additions & 9 deletions config/nvim/lua/plugins/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ return {
{
"nvim-telescope/telescope.nvim",
keys = {
-- add a keymap to browse plugin files
-- stylua: ignore
-- change some options
-- disbale unwanted keymaps
{ "<leader>gs", false },
{ "<leader>gc", false },
},
defaults = {
opts = {
opts = {
defaults = {
layout_strategy = "flex",
sorting_strategy = "ascending",
winblend = 0,
mappings = {
i = {
["<C-u>"] = false,
["<C-n>"] = false,
["<C-p>"] = false,
["<C-n>"] = actions.move_selection_next,
["<C-p>"] = actions.move_selection_previous,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
},
Expand Down Expand Up @@ -99,7 +99,7 @@ return {
},
},
},
config = function(_, opt)
config = function(_, opts)
local custom_telescope = require("../utils/telescope-functions")

local builtin = require("telescope.builtin")
Expand Down Expand Up @@ -135,7 +135,7 @@ return {
["<leader>tr"] = { builtin.resume, "Resume" },
})

require("telescope").setup(opt)
require("telescope").setup(opts)
end,
},
{
Expand Down

0 comments on commit 642c436

Please sign in to comment.