Skip to content

Commit 94e3ad1

Browse files
committed
add configuration for lazyvim
1 parent 721c925 commit 94e3ad1

File tree

18 files changed

+1403
-0
lines changed

18 files changed

+1403
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
if vim.loader then
2+
vim.loader.enable()
3+
end
4+
5+
_G.dd = function(...)
6+
require("util.debug").dump(...)
7+
end
8+
vim.print = _G.dd
9+
10+
require("config.lazy")
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"LazyVim": { "branch": "main", "commit": "530e94a9fa19577401e968a9673282c3d79f01e3" },
3+
"LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" },
4+
"SchemaStore.nvim": { "branch": "main", "commit": "35a0998728380a17b8590447e8207391411c667a" },
5+
"bufferline.nvim": { "branch": "main", "commit": "73540cb95f8d95aa1af3ed57713c6720c78af915" },
6+
"catppuccin": { "branch": "main", "commit": "d97387aea8264f484bb5d5e74f2182a06c83e0d8" },
7+
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
8+
"cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" },
9+
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
10+
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
11+
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
12+
"conform.nvim": { "branch": "master", "commit": "d2a54aa54d84117ac3d99afdd527281f81e9e2c9" },
13+
"copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" },
14+
"copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" },
15+
"crates.nvim": { "branch": "main", "commit": "7d8541ec0e3b30ac2c43864d3ee13a632e1231ed" },
16+
"dashboard-nvim": { "branch": "master", "commit": "a0a78099658c7d4be3714f657b18ca8285d5d106" },
17+
"dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" },
18+
"dracula.nvim": { "branch": "main", "commit": "8d8bddb8814c3e7e62d80dda65a9876f97eb699c" },
19+
"dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" },
20+
"friendly-snippets": { "branch": "main", "commit": "3e9a3f5a0cfcef1741e352c37bda4e82e5eb846a" },
21+
"git.nvim": { "branch": "main", "commit": "cc116ae91efd307836d24b868916f50a94c6daf9" },
22+
"gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" },
23+
"inc-rename.nvim": { "branch": "main", "commit": "1d7d3f647d0928614c00ca9ef4ce695c45147c05" },
24+
"incline.nvim": { "branch": "main", "commit": "3e8edbc457daab8dba087dbba319865a912be7f9" },
25+
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
26+
"lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" },
27+
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
28+
"mason-lspconfig.nvim": { "branch": "main", "commit": "05744f0f1967b5757bd05c08df4271ab8ec990aa" },
29+
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
30+
"mini.ai": { "branch": "main", "commit": "55e9b7217f29e62f734e239bfeed5731a065d801" },
31+
"mini.animate": { "branch": "main", "commit": "82519630b2760ffc516ebc387bef632f9c07b9f5" },
32+
"mini.bracketed": { "branch": "main", "commit": "65c7dfb51e832de9e279e5d5b0741e7af6755ab5" },
33+
"mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" },
34+
"mini.comment": { "branch": "main", "commit": "f9f1a646fd3d9df7397aa1b9550a875fe8189eb0" },
35+
"mini.hipatterns": { "branch": "main", "commit": "088bbfef23e17934080f125751a94a2758ba7fdf" },
36+
"mini.indentscope": { "branch": "main", "commit": "a8274b6ea2d868198d27bd91a31ed5ea3a6a5744" },
37+
"mini.pairs": { "branch": "main", "commit": "5c975d8f68dc1e11bf4b20ced71e7987ed782513" },
38+
"mini.surround": { "branch": "main", "commit": "0f528eb2e1bab420c0569d9e52615144c51db920" },
39+
"neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" },
40+
"neoconf.nvim": { "branch": "main", "commit": "c58b3f747ac1e1abe96a957c583b4330fabed77a" },
41+
"neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
42+
"neogen": { "branch": "main", "commit": "0daffcec249bf42275e322361fe55b89a05ff278" },
43+
"noice.nvim": { "branch": "main", "commit": "09102ca2e9a3e9302119fdaf7a059a034e4a626d" },
44+
"nui.nvim": { "branch": "main", "commit": "a3597dc88b53489d3fddbddbbd13787355253bb0" },
45+
"nvim-cmp": { "branch": "main", "commit": "cd2cf0c124d3de577fb5449746568ee8e601afc8" },
46+
"nvim-lint": { "branch": "master", "commit": "83ee4952a968d89329e5a49b4648831d98124783" },
47+
"nvim-lspconfig": { "branch": "master", "commit": "a3d9395455f2b2e3b50a0b0f37b8b4c23683f44a" },
48+
"nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
49+
"nvim-spectre": { "branch": "master", "commit": "4651801ba37a9407b7257287aec45b6653ffc5e9" },
50+
"nvim-tree.lua": { "branch": "master", "commit": "76db7ed0da3027882dd0a72de18643c2e26956dc" },
51+
"nvim-treesitter": { "branch": "master", "commit": "707b0dcf7641fa3a2aaad5053b215503f54f89aa" },
52+
"nvim-treesitter-context": { "branch": "master", "commit": "2650e6431f7daba5d9c2c64134fa5eb2312eb3d7" },
53+
"nvim-treesitter-textobjects": { "branch": "master", "commit": "dfa4178c0cadb44f687603d72ad0908474c28dd9" },
54+
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
55+
"nvim-ts-context-commentstring": { "branch": "main", "commit": "0bdccb9c67a42a5e2d99384dc9bfa29b1451528f" },
56+
"nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" },
57+
"persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" },
58+
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
59+
"plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" },
60+
"refactoring.nvim": { "branch": "master", "commit": "d2786877c91aa409c824f27b4ce8a9f560dda60a" },
61+
"rustaceanvim": { "branch": "master", "commit": "2eb8776df1aab03f514b38ddc39af57efbd8970b" },
62+
"solarized-osaka.nvim": { "branch": "main", "commit": "92c5def2b522e7869b29b55b448544f226e07524" },
63+
"symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
64+
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" },
65+
"telescope-file-browser.nvim": { "branch": "master", "commit": "4d5fd21bae12ee6e9a79232e1c377f43c419d0c5" },
66+
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
67+
"telescope-recent-files": { "branch": "main", "commit": "6893cda11625254cc7dc2ea76e0a100c7deeb028" },
68+
"telescope.nvim": { "branch": "master", "commit": "fac83a556e7b710dc31433dec727361ca062dbe9" },
69+
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },
70+
"tokyonight.nvim": { "branch": "main", "commit": "67afeaf7fd6ebba000633e89f63c31694057edde" },
71+
"trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" },
72+
"vim-illuminate": { "branch": "master", "commit": "e522e0dd742a83506db0a72e1ced68c9c130f185" },
73+
"vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" },
74+
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },
75+
"zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" }
76+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extras": [
3+
4+
],
5+
"news": {
6+
"NEWS.md": "3314",
7+
"doc/news.txt": "13995"
8+
},
9+
"version": 3
10+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-- Turn off paste mode when leaving insert
2+
vim.api.nvim_create_autocmd("InsertLeave", {
3+
pattern = "*",
4+
command = "set nopaste",
5+
})
6+
7+
-- Disable the concealing in some file formats
8+
-- The default conceallevel is 3 in LazyVim
9+
vim.api.nvim_create_autocmd("FileType", {
10+
pattern = { "json", "jsonc", "markdown" },
11+
callback = function()
12+
vim.opt.conceallevel = 0
13+
end,
14+
})
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
local discipline = require("craftzdog.discipline")
2+
3+
--discipline.cowboy()
4+
5+
local keymap = vim.keymap
6+
local opts = { noremap = true, silent = true }
7+
8+
--personal ones
9+
keymap.set("n", "zz", "<Esc>:update<cr>")
10+
keymap.set("i", "zz", "<Esc>:update<cr>")
11+
keymap.set("n", "<C-s>", "<C-^>") -- toggle last file
12+
keymap.set("i", "jk", "<ESC>") --remap escape to jk
13+
keymap.set("n", "<C-j>", "<C-W>j")
14+
-- move between panels
15+
keymap.set("n", "<C-k>", "<C-W>k")
16+
keymap.set("n", "<C-h>", "<C-W>h")
17+
keymap.set("n", "<C-l>", "<C-W>l")
18+
keymap.set("n", ";", "<S-$>") -- Go to end of line
19+
20+
-- Do things without affecting the registers
21+
keymap.set("n", "x", '"_x')
22+
keymap.set("n", "<Leader>p", '"9p')
23+
keymap.set("n", "<Leader>P", '"9P')
24+
keymap.set("v", "<Leader>p", '"9p')
25+
keymap.set("n", "<Leader>c", '"_c')
26+
keymap.set("n", "<Leader>C", '"_C')
27+
keymap.set("v", "<Leader>c", '"_c')
28+
keymap.set("v", "<Leader>C", '"_C')
29+
keymap.set("n", "<Leader>d", '"_d')
30+
keymap.set("n", "<Leader>D", '"_D')
31+
keymap.set("v", "<Leader>d", '"_d')
32+
keymap.set("v", "<Leader>D", '"_D')
33+
34+
-- Increment/decrement
35+
keymap.set("n", "+", "<C-a>")
36+
keymap.set("n", "-", "<C-x>")
37+
38+
-- Delete a word backwards
39+
--keymap.set("n", "dw", 'vb"_d')
40+
41+
-- Select all
42+
keymap.set("n", "<C-g>", "gg<S-v>G")
43+
44+
-- Save with root permission (not working for now)
45+
--vim.api.nvim_create_user_command('W', 'w !sudo tee > /dev/null %', {})
46+
47+
-- Disable continuations
48+
keymap.set("n", "<Leader>o", "o<Esc>^Da", opts)
49+
keymap.set("n", "<Leader>O", "O<Esc>^Da", opts)
50+
51+
-- Jumplist
52+
keymap.set("n", "<C-m>", "<C-i>", opts)
53+
54+
-- New tab
55+
keymap.set("n", "te", ":tabedit")
56+
keymap.set("n", "<tab>", ":tabnext<Return>", opts)
57+
keymap.set("n", "<s-tab>", ":tabprev<Return>", opts)
58+
-- Split window
59+
keymap.set("n", "ss", ":split<Return>", opts)
60+
keymap.set("n", "sv", ":vsplit<Return>", opts)
61+
-- Move window
62+
keymap.set("n", "sh", "<C-w>h")
63+
keymap.set("n", "sk", "<C-w>k")
64+
keymap.set("n", "sj", "<C-w>j")
65+
keymap.set("n", "sl", "<C-w>l")
66+
67+
-- Resize window
68+
keymap.set("n", "<C-w><left>", "<C-w><")
69+
keymap.set("n", "<C-w><right>", "<C-w>>")
70+
keymap.set("n", "<C-w><up>", "<C-w>+")
71+
keymap.set("n", "<C-w><down>", "<C-w>-")
72+
73+
-- Diagnostics
74+
keymap.set("n", "<C-j>", function()
75+
vim.diagnostic.goto_next()
76+
end, opts)
77+
78+
keymap.set("n", "<leader>r", function()
79+
require("craftzdog.hsl").replaceHexWithHSL()
80+
end)
81+
82+
keymap.set("n", "<leader>i", function()
83+
require("craftzdog.lsp").toggleInlayHints()
84+
end)
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
2+
if not vim.loop.fs_stat(lazypath) then
3+
vim.fn.system({
4+
"git",
5+
"clone",
6+
"--filter=blob:none",
7+
"https://github.com/folke/lazy.nvim.git",
8+
"--branch=stable", -- latest stable release
9+
lazypath,
10+
})
11+
end
12+
vim.opt.rtp:prepend(lazypath)
13+
14+
require("lazy").setup({
15+
spec = {
16+
-- add LazyVim and import its plugins
17+
{
18+
"LazyVim/LazyVim",
19+
import = "lazyvim.plugins",
20+
opts = {
21+
colorscheme = "solarized-osaka",
22+
news = {
23+
lazyvim = true,
24+
neovim = true,
25+
},
26+
},
27+
},
28+
-- import any extras modules here
29+
{ import = "lazyvim.plugins.extras.linting.eslint" },
30+
{ import = "lazyvim.plugins.extras.formatting.prettier" },
31+
{ import = "lazyvim.plugins.extras.lang.typescript" },
32+
{ import = "lazyvim.plugins.extras.lang.json" },
33+
-- { import = "lazyvim.plugins.extras.lang.markdown" },
34+
{ import = "lazyvim.plugins.extras.lang.rust" },
35+
{ import = "lazyvim.plugins.extras.lang.tailwind" },
36+
{ import = "lazyvim.plugins.extras.coding.copilot" },
37+
-- { import = "lazyvim.plugins.extras.dap.core" },
38+
-- { import = "lazyvim.plugins.extras.vscode" },
39+
{ import = "lazyvim.plugins.extras.util.mini-hipatterns" },
40+
-- { import = "lazyvim.plugins.extras.test.core" },
41+
-- { import = "lazyvim.plugins.extras.coding.yanky" },
42+
-- { import = "lazyvim.plugins.extras.editor.mini-files" },
43+
-- { import = "lazyvim.plugins.extras.util.project" },
44+
{ import = "plugins" },
45+
},
46+
defaults = {
47+
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
48+
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
49+
lazy = false,
50+
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
51+
-- have outdated releases, which may break your Neovim install.
52+
version = false, -- always use the latest git commit
53+
-- version = "*", -- try installing the latest stable version for plugins that support semver
54+
},
55+
dev = {
56+
path = "~/.ghq/github.com",
57+
},
58+
checker = { enabled = true }, -- automatically check for plugin updates
59+
performance = {
60+
cache = {
61+
enabled = true,
62+
-- disable_events = {},
63+
},
64+
rtp = {
65+
-- disable some rtp plugins
66+
disabled_plugins = {
67+
"gzip",
68+
-- "matchit",
69+
-- "matchparen",
70+
"netrwPlugin",
71+
"rplugin",
72+
"tarPlugin",
73+
"tohtml",
74+
"tutor",
75+
"zipPlugin",
76+
},
77+
},
78+
},
79+
ui = {
80+
custom_keys = {
81+
["<localleader>d"] = function(plugin)
82+
dd(plugin)
83+
end,
84+
},
85+
},
86+
debug = false,
87+
})
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
vim.g.mapleader = " "
2+
3+
vim.opt.encoding = "utf-8"
4+
vim.opt.fileencoding = "utf-8"
5+
6+
vim.opt.number = true
7+
8+
vim.opt.title = true
9+
vim.opt.autoindent = true
10+
vim.opt.smartindent = true
11+
vim.opt.hlsearch = true
12+
vim.opt.backup = false
13+
vim.opt.showcmd = true
14+
vim.opt.cmdheight = 1
15+
vim.opt.laststatus = 2
16+
vim.opt.expandtab = true
17+
vim.opt.scrolloff = 10
18+
vim.opt.shell = "iterm2"
19+
vim.opt.backupskip = { "/tmp/*", "/private/tmp/*" }
20+
vim.opt.inccommand = "split"
21+
vim.opt.ignorecase = true -- Case insensitive searching UNLESS /C or capital in search
22+
vim.opt.smarttab = true
23+
vim.opt.breakindent = true
24+
vim.opt.shiftwidth = 2
25+
vim.opt.tabstop = 2
26+
vim.opt.wrap = false -- No Wrap lines
27+
vim.opt.backspace = { "start", "eol", "indent" }
28+
vim.opt.path:append({ "**" }) -- Finding files - Search down into subfolders
29+
vim.opt.wildignore:append({ "*/node_modules/*" })
30+
vim.opt.splitbelow = true -- Put new windows below current
31+
vim.opt.splitright = true -- Put new windows right of current
32+
vim.opt.splitkeep = "cursor"
33+
vim.opt.mouse = "a"
34+
35+
-- Undercurl
36+
vim.cmd([[let &t_Cs = "\e[4:3m"]])
37+
vim.cmd([[let &t_Ce = "\e[4:0m"]])
38+
39+
-- Add asterisks in block comments
40+
vim.opt.formatoptions:append({ "r" })
41+
42+
vim.cmd([[au BufNewFile,BufRead *.astro setf astro]])
43+
vim.cmd([[au BufNewFile,BufRead Podfile setf ruby]])
44+
45+
if vim.fn.has("nvim-0.8") == 1 then
46+
vim.opt.cmdheight = 0
47+
end
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
local M = {}
2+
3+
function M.cowboy()
4+
---@type table?
5+
local id
6+
local ok = true
7+
for _, key in ipairs({ "h", "j", "k", "l", "+", "-" }) do
8+
local count = 0
9+
local timer = assert(vim.loop.new_timer())
10+
local map = key
11+
vim.keymap.set("n", key, function()
12+
if vim.v.count > 0 then
13+
count = 0
14+
end
15+
if count >= 10 then
16+
ok, id = pcall(vim.notify, "Hold it Cowboy!", vim.log.levels.WARN, {
17+
icon = "🤠",
18+
replace = id,
19+
keep = function()
20+
return count >= 10
21+
end,
22+
})
23+
if not ok then
24+
id = nil
25+
return map
26+
end
27+
else
28+
count = count + 1
29+
timer:start(2000, 0, function()
30+
count = 0
31+
end)
32+
return map
33+
end
34+
end, { expr = true, silent = true })
35+
end
36+
end
37+
38+
return M

0 commit comments

Comments
 (0)