Skip to content

Commit

Permalink
🔧 LazyVim config tweaking (#84)
Browse files Browse the repository at this point in the history
* 🔧 Enable scroll animate with mini.animage

* ✨ support function rename

* 🔧 Add marksman root folder marker

* 🔧 Set up local spelling file

* 🔧 move vim spelling to nvim

nvim is now default editor, vim backup and spelling in vim is not essential.
Better now to go with the defaults of nvim

* 🐛 use opts map not function to allow merge with default

If the opt is a function it seems to replace the default instead of merging with
the default

* ✨ use project local spell file if it exists

* 🔧 Configure markdownlint cli2 (to allow long lines for tables)

* 🔧 Ignore snippets for gitcommit and markdown

Low value and leads to window text shuffle as you type

* 📦️ update packages
  • Loading branch information
ianhomer authored Oct 20, 2024
1 parent b1b051f commit 5079275
Show file tree
Hide file tree
Showing 18 changed files with 493 additions and 442 deletions.
310 changes: 140 additions & 170 deletions config/brew/Brewfile.lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions config/node/global.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ git-open@^3
jsonlint@^1
lua-fmt@^2
markdownlint-cli@^0
markdownlint-cli2@^0
neovim@^5
prettier@^3
@fsouza/prettierd@^0
Expand Down
8 changes: 8 additions & 0 deletions dotfiles/markdownlint/.config/.markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"default": true,
"line_length": false,
"code-block-style": false,
"MD013": {
"tables": false
}
}
5 changes: 0 additions & 5 deletions dotfiles/markdownlint/.config/markdownlint

This file was deleted.

Empty file.
10 changes: 10 additions & 0 deletions dotfiles/nvim/.config/nvim/lua/config/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,15 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
-- l don't break long lines (once they'r long)
vim.opt_local.formatoptions = "jcqln"
vim.opt_local.formatexpr = ""

-- Use project local spellfile if it exists
local dot_git_path = vim.fn.finddir(".git", ".;")
if vim.fn.isdirectory(dot_git_path) ~= 0 then
local project_spelling_file = vim.fn.fnamemodify(dot_git_path, ":h") .. "/.vim/local.utf-8.add"
if vim.fn.filereadable(project_spelling_file) ~= 0 then
local spelling_files = project_spelling_file
vim.opt_local.spellfile = spelling_files
end
end
end,
})
2 changes: 2 additions & 0 deletions dotfiles/nvim/.config/nvim/lua/config/lazy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
{ import = "lazyvim.plugins.extras.ui.mini-animate" },
{ import = "lazyvim.plugins.extras.coding.mini-surround" },
{ import = "lazyvim.plugins.extras.editor.inc-rename" },
-- import/override with your plugins
{ import = "plugins" },
},
Expand Down
13 changes: 13 additions & 0 deletions dotfiles/nvim/.config/nvim/lua/config/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,16 @@ vim.g.autoformat = false
local opt = vim.opt
opt.relativenumber = false
opt.conceallevel = 0

-- Shift + J/K moves selected lines down/up in visual mode
local cmd = vim.cmd
cmd([[
vnoremap <silent> J :m '>+1<CR>gv=gv
vnoremap <silent> K :m '<-2<CR>gv=gv
vnoremap <silent> <S-Up> :m '<-2<CR>gv=gv
vnoremap <silent> <S-Down> :m '>+1<CR>gv=gv
nnoremap <silent> <S-Up> :m-2<CR>
nnoremap <silent> <S-Down> :m+<CR>
inoremap <silent> <S-Up> <Esc>:m-2<CR>
inoremap <silent> <S-Down> <Esc>:m+<CR>
]])
6 changes: 6 additions & 0 deletions dotfiles/nvim/.config/nvim/lua/plugins/coding.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
return {
"garymjr/nvim-snippets",
opts = {
ignored_filetypes = { "markdown", "gitcommit" },
}
}
8 changes: 0 additions & 8 deletions dotfiles/nvim/.config/nvim/lua/plugins/fugitive.lua

This file was deleted.

13 changes: 13 additions & 0 deletions dotfiles/nvim/.config/nvim/lua/plugins/inc-rename.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
return {
"smjonas/inc-rename.nvim",
keys = {
{
"<leader>rn",
function()
return ":IncRename " .. vim.fn.expand("<cword>")
end,
desc = "Incremental Rename",
expr = true,
},
},
}
12 changes: 12 additions & 0 deletions dotfiles/nvim/.config/nvim/lua/plugins/linting.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return {
{
"mfussenegger/nvim-lint",
opts = {
linters = {
["markdownlint-cli2"] = {
args = { "--config", "~/.config/.markdownlint.jsonc", "--" },
},
},
},
},
}
8 changes: 8 additions & 0 deletions dotfiles/nvim/.config/nvim/lua/plugins/mini-animate.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
return {
"echasnovski/mini.animate",
opts = {
cursor = {
enable = false,
},
},
}
45 changes: 21 additions & 24 deletions dotfiles/nvim/.config/nvim/lua/plugins/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,30 @@ return {
{
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-telescope/telescope-symbols.nvim" },
opts = function()
local actions = require("telescope.actions")

return {
defaults = {
mappings = {
i = {
["<esc>"] = actions.close,
},
opts = {
defaults = {
mappings = {
i = {
["<esc>"] = require("telescope.actions").close
-- ["<esc>"] = function() require("telescope.actions").close end,
},
},
layout_strategy = "vertical",
layout_config = {
horizontal = {
prompt_position = "bottom",
},
layout_strategy = "vertical",
layout_config = {
horizontal = {
prompt_position = "bottom",
},
vertical = {
mirror = false,
},
height = 0.99,
width = 0.99,
vertical = {
mirror = false,
},
winblend = 0,
border = {},
borderchars = { "", "", "", "", "", "", "", "" },
height = 0.99,
width = 0.99,
},
}
end,
winblend = 0,
border = {},
borderchars = { "", "", "", "", "", "", "", "" },
},
},

keys = {
{
Expand Down
11 changes: 11 additions & 0 deletions dotfiles/nvim/.config/nvim/lua/plugins/vim-plugins.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
return {
{ "tpope/vim-eunuch" },
{
"tpope/vim-fugitive",
lazy = false,
keys = {
{ "<leader>gg", "<cmd>Git<cr>", desc = "Fugitive" },
{ "<leader>gp", "<cmd>Git push<cr>", desc = "Git push" },
},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -424,3 +424,8 @@ zerover
zettelkasten
pytest
LangChain
Nord
Mooseman
AppSync
CloudFormation
AWS
8 changes: 4 additions & 4 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"author": "anon",
"description": "dotme test",
"devDependencies": {
"@types/node": "22.7.4",
"@typescript-eslint/eslint-plugin": "8.8.0",
"@typescript-eslint/parser": "8.8.0",
"@types/node": "22.7.7",
"@typescript-eslint/eslint-plugin": "8.10.0",
"@typescript-eslint/parser": "8.10.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-react": "7.37.1",
"eslint-plugin-sonarjs": "1.0.3",
"jest": "^29.7.0",
"prettier": "3.3.3",
"ts-node": "10.9.2",
"typescript": "5.6.2"
"typescript": "5.6.3"
},
"license": "ISC",
"main": "scratch.js",
Expand Down
Loading

0 comments on commit 5079275

Please sign in to comment.