···11-vim.opt.termguicolors = true
22-33-vim.opt.background = "light"
44-55-lvim.colorscheme = "everforest"
66-vim.g.everforest_better_performance = 1
77-88-lvim.builtin.lualine.options.theme = 'everforest'
99-1010-lvim.builtin.bufferline.options.always_show_bufferline = true
1111-1212----@diagnostic disable-next-line: undefined-field
1313-vim.opt.fillchars:append { diff = "╱" }
1414-1515-vim.opt.relativenumber = true
1616-vim.opt.shiftwidth = 2
1717-vim.opt.tabstop = 2
1818-vim.opt.clipboard = ""
1919-2020--- Line wrapping for markdown and text files
2121-function SetLineWrapForTextFiles(opts)
2222- -- Wrap lines for markdown and text files, or unset filetypes
2323- local ft = vim.bo[opts.buf].filetype
2424- if ft == "markdown" or ft == "text" then
2525- vim.wo.wrap = true
2626- vim.wo.linebreak = true
2727- vim.wo.list = false
2828- else
2929- vim.wo.wrap = false
3030- vim.wo.linebreak = false
3131- vim.wo.list = true
3232- end
3333-end
3434-3535-local myAuGroup = vim.api.nvim_create_augroup("MyGroup", { clear = true })
3636-lvim.autocommands = {
3737- {
3838- "FileType", {
3939- pattern = { "*" },
4040- group = myAuGroup,
4141- callback = SetLineWrapForTextFiles
4242- }
4343- },
4444- { "BufAdd", {
4545- pattern = { "*" },
4646- group = myAuGroup,
4747- callback = SetLineWrapForTextFiles
4848- } },
4949-}
-37
vim/lvim/lua/user/git.lua
···11--- Calls the git-open command to get the URL for a specific file/line
22--- in the github or gitlab remote repo.
33-function GitUrl(line1, line2)
44- local lines = ""
55-66- -- Check if multiple lines are selected
77- if line1 ~= line2 then
88- lines = line1 .. "-" .. line2
99- else
1010- lines = line1
1111- end
1212-1313- local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
1414- local full_path = vim.fn.expand("%:p")
1515- local filename = string.sub(full_path, string.len(git_root) + 2)
1616-1717- -- Create the shell command
1818- return string.format("git-open '%s' %s", filename, lines)
1919-end
2020-2121-function GitOpen(line1, line2)
2222- local git_open_cmd = GitUrl(line1, line2)
2323- vim.cmd(string.format("!%s | xargs open", git_open_cmd))
2424-end
2525-2626-function GitCopy(line1, line2)
2727- local git_open_cmd = GitUrl(line1, line2)
2828- vim.cmd(string.format("!%s | pbcopy", git_open_cmd))
2929-end
3030-3131-function GitDiff()
3232- local target = vim.fn.input("Diff target: ")
3333- require('gitsigns').diffthis(target)
3434-end
3535-3636-vim.cmd [[command! -range GitOpen :lua GitOpen(<line1>, <line2>)]]
3737-vim.cmd [[command! -range GitCopy :lua GitCopy(<line1>, <line2>)]]
-53
vim/lvim/lua/user/js-ts-lsp.lua
···11-local M = {}
22-33-local function file_exists(filepath)
44- local file_stat = vim.loop.fs_stat(filepath)
55- return file_stat and file_stat.type or false
66-end
77-88----
99--- Initializes either tsserver or denols, based on presence of
1010--- relevant files in project root.
1111----
1212-function M.setup()
1313- local root = vim.fn.getcwd()
1414- local deno_files = { "deno.json", "deno.jsonc", "import_map.json" }
1515-1616- local is_deno = false
1717- local import_map = ""
1818-1919- for _, file in ipairs(deno_files) do
2020- local filepath = root .. '/' .. file
2121- if file_exists(filepath) then
2222- is_deno = true
2323- import_map = filepath
2424- break
2525- end
2626- end
2727-2828- -- This will look in every folder from the file path to the project root,
2929- -- but in larger projects it can make opening a file _very_ slow.
3030- --
3131- -- local candidates = vim.fn.glob(root .. '/**/' .. file, false, true)
3232- -- for _, candidate in ipairs(candidates) do
3333- -- if vim.fn.filereadable(candidate) == 1 then
3434- -- is_deno = true
3535- -- import_map = candidate
3636- -- break
3737- -- end
3838- -- end
3939-4040- -- if is_deno then
4141- -- break
4242- -- end
4343-4444- if is_deno then
4545- require("lvim.lsp.manager").setup("denols", {
4646- settings = { import_map = import_map }
4747- })
4848- else
4949- require("lvim.lsp.manager").setup("tsserver", {})
5050- end
5151-end
5252-5353-return M
-110
vim/lvim/lua/user/keys.lua
···11-lvim.keys.normal_mode[";"] = ":"
22-33--- Disable autocomplete auto trigger
44-lvim.builtin.cmp.completion.autocomplete = false
55-66--- File navigation
77-lvim.keys.normal_mode["\\"] = ":Neotree position=left reveal<cr>"
88-lvim.keys.normal_mode["E"] = ":Neotree position=current reveal<cr>"
99-lvim.builtin.which_key.mappings["e"] = {
1010- ":Neotree position=left toggle<cr>",
1111- "Toggle Neotree",
1212- mode = { "n" }
1313-}
1414-lvim.builtin.which_key.mappings["o"] = { ":Outline<cr>", "Toggle outline sidebar" }
1515-1616--- Buffer cycling
1717-lvim.keys.normal_mode["<S-h>"] = ":bprev<cr>"
1818-lvim.keys.normal_mode["<S-l>"] = ":bnext<cr>"
1919--- lvim.builtin.which_key.mappings["CC"] = { ":bufdo bd<cr>", "Close all buffers", mode = { "n" } }
2020-2121--- Tab management
2222-lvim.keys.normal_mode["<C-n>"] = ":tabnext<cr>"
2323-lvim.keys.normal_mode["<C-p>"] = ":tabprev<cr>"
2424-lvim.builtin.which_key.mappings["tn"] = { ":tabnew<cr>", "New tab", mode = { "n" } }
2525-lvim.builtin.which_key.mappings["td"] = { ":tabclose<cr>", "Close tab", mode = { "n" } }
2626-2727--- UI toggles
2828-lvim.builtin.which_key.mappings["Z"] = { ":ZenMode<cr>", "Zen mode", mode = { "n" } }
2929-lvim.builtin.which_key.mappings["m"] = { ":MinimapToggle<cr>", "Minimap toggle", mode = { "n" } }
3030-3131--- Horizontal scrolling
3232--- TODO: these don't work! I'd like C-S-l/h, but something doesn't work quite right with shift on mac
3333--- lvim.keys.normal_mode["<M-h>"] = "3zh"
3434--- lvim.keys.normal_mode["<M-l>"] = "3zl"
3535-3636--- Splits
3737-lvim.builtin.which_key.mappings["v?"] = { ":sp<cr>", "Split horizontal", mode = { "n" } }
3838-lvim.builtin.which_key.mappings["v/"] = { ":vsp<cr>", "Split vertical", mode = { "n" } }
3939-4040--- Quit
4141-lvim.builtin.which_key.mappings["Q"] = { ":qa<cr>", "Quit all" }
4242-lvim.builtin.which_key.mappings["X"] = { ":qa!<cr>", "Quit all (force)" }
4343-4444--- AI
4545-lvim.builtin.which_key.mappings["aa"] = { ":AI ", "AI complete text" }
4646-lvim.builtin.which_key.mappings["ae"] = { ":AIEdit ", "AI edit text" }
4747-lvim.builtin.which_key.mappings["ac"] = { ":AIChat ", "AI chat" }
4848-lvim.builtin.which_key.mappings["ar"] = { ":AIRedo<cr>", "Redo last AI command" }
4949-5050--- Git stuff!
5151-lvim.builtin.which_key.mappings["gh"] = {
5252- ":DiffviewFileHistory %<cr>",
5353- "View file history",
5454- mode = { "n" },
5555- silent = true,
5656-}
5757-lvim.builtin.which_key.mappings["gH"] = {
5858- ":DiffviewFileHistory<cr>",
5959- "View repo history",
6060- mode = { "n" },
6161- silent = true,
6262-}
6363-lvim.builtin.which_key.mappings["gO"] = {
6464- ":GitOpen<cr>",
6565- "Open file in github/gitlab",
6666- mode = { "n", "v" },
6767- silent = true,
6868-}
6969-lvim.builtin.which_key.mappings["gL"] = {
7070- ":GitCopy<cr>",
7171- "Copy link to file in github/gitlab",
7272- mode = { "n", "v" },
7373- silent = true,
7474-}
7575-lvim.builtin.which_key.mappings["gD"] = {
7676- ":lua GitDiff()<cr>",
7777- "Diff buffer against provided target",
7878- mode = { "n" },
7979- silent = true,
8080-}
8181-lvim.builtin.which_key.mappings["Gd"] = {
8282- ":DiffviewOpen<cr>",
8383- "Diff all files against index",
8484- mode = { "n" },
8585- silent = true,
8686-}
8787-lvim.builtin.which_key.mappings["GD"] = {
8888- ":DiffviewOpen ",
8989- "Diff all files against provided target",
9090- mode = { "n" },
9191-}
9292-9393--- LSP
9494-lvim.builtin.which_key.mappings["lR"] = {
9595- ":TSRemoveUnusedImports<cr>",
9696- "Remove unused imports (TS)",
9797- mode = { "n" },
9898-}
9999-100100--- <esc-j> is an alias for <alt-j>, which swaps a line up or down
101101--- If I press `esc` then `j` or `k` to quickly, it swaps lines unintentially.
102102--- Since this isn't a feature I use, I'm just disabling it.
103103-lvim.keys.insert_mode["<A-j>"] = false
104104-lvim.keys.insert_mode["<A-k>"] = false
105105-lvim.keys.normal_mode["<A-j>"] = false
106106-lvim.keys.normal_mode["<A-k>"] = false
107107-lvim.keys.visual_block_mode["<A-j>"] = false
108108-lvim.keys.visual_block_mode["<A-k>"] = false
109109-lvim.keys.visual_block_mode["K"] = false
110110-lvim.keys.visual_block_mode["J"] = false
···11-// Zed settings
22-//
33-// For information on how to configure Zed, see the Zed
44-// documentation: https://zed.dev/docs/configuring-zed
55-//
66-// To see all of Zed's default settings without changing your
77-// custom settings, run the `open default settings` command
88-// from the command palette or from `Zed` application menu.
99-{
1010- "vim_mode": true,
1111- "theme": "Solarized Light",
1212- "ui_font_size": 16,
1313- "ui_font_family": "Iosevka Nerd Font Mono",
1414- "relative_line_numbers": true,
1515- "terminal": {
1616- "line_height": "standard"
1717- },
1818- "buffer_font_size": 16,
1919- "buffer_line_height": { "custom": 1.4 },
2020- "buffer_font_family": "Iosevka Nerd Font Mono"
2121-}