Skip to content

Instantly share code, notes, and snippets.

@rob1121
Last active September 30, 2024 02:19
Show Gist options
  • Save rob1121/09be47a6d5e29a3d9dc37ca290200570 to your computer and use it in GitHub Desktop.
Save rob1121/09be47a6d5e29a3d9dc37ca290200570 to your computer and use it in GitHub Desktop.
-- Read the docs: https://www.lunarvim.org/docs/configuration
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
-- Forum: https://www.reddit.com/r/lunarvim/
-- Discord: https://discord.com/invite/Xb9B4Ny
--
--
--lvim setup
vim.opt.wrap = true
vim.opt.linebreak = true
vim.opt.textwidth = 50
--code folding
vim.opt.foldmethod = "indent"
vim.opt.foldlevel = 99
vim.opt.foldenable = true
-- keyboard bindings
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
lvim.keys.normal_mode["<S-h>"] = ":bprev<cr>"
lvim.keys.normal_mode["<S-l>"] = ":bnext<cr>"
lvim.keys.normal_mode["sv"] = ":vsplit<cr>"
lvim.keys.normal_mode["sh"] = ":split<cr>"
vim.keymap.set('i', 'jj', '<Esc>')
vim.keymap.set('i', 'jk', '<Esc>')
vim.keymap.set('i', 'kj', '<Esc>')
vim.keymap.set('i', 'kk', '<Esc>')
--nvim-tree
lvim.builtin.nvimtree.setup.view.adaptive_size = true
lvim.builtin.nvimtree.setup.view.width = 70
--eslint
local linters = require "lvim.lsp.null-ls.linters"
linters.setup {
{ command = "eslint", filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" } }
}
--prettier formatter
local formatters = require "lvim.lsp.null-ls.formatters"
formatters.setup {
{
command = "prettier",
filetypes = { "typescript", "typescriptreact", "scss", "javascript", "javascriptreact" },
},
}
--tailwindcss
require("lvim.lsp.manager").setup "tailwindcss"
-- plugins
lvim.plugins = {
{
"Supermaven/supermaven-nvim",
config = function()
local supermaven = require("supermaven-nvim")
supermaven.setup({
disable_keymaps = true,
})
local completion_preview = require("supermaven-nvim.completion_preview")
vim.keymap.set('i', '<c-a>', completion_preview.on_accept_suggestion,
{ noremap = true, silent = true })
vim.keymap.set('i', '<c-j>', completion_preview.on_accept_suggestion_word,
{ noremap = true, silent = true })
vim.keymap.set('i', '<c-]>', completion_preview.on_accept_suggestion_word,
{ noremap = true, silent = true })
local api = require("supermaven-nvim.api")
-- api.start()
api.use_free_version()
end
},
}
-- local cmp = require "cmp"
-- COPILOT SETTING
-- vim.g.copilot_no_tab_map = true
-- vim.g.copilot_assume_mapped = true
-- vim.g.copilot_tab_fallback = ""
-- lvim.builtin.cmp.mapping["<Tab>"] = function(fallback)
-- if cmp.visible() then
-- cmp.select_next_item()
-- else
-- local copilot_keys = vim.fn["copilot#Accept"]()
-- if copilot_keys ~= "" then
-- vim.api.nvim_feedkeys(copilot_keys, "i", true)
-- else
-- fallback()
-- end
-- end
-- end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment