Last active
May 1, 2024 16:32
-
-
Save ZenToad/87049772648a0d3b1657ad1a4868d525 to your computer and use it in GitHub Desktop.
Lazy.nvim config files 2024
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Path for this is: | |
HOME/AppData.Local/nvim/init.lua | |
HOME/AppData.Local/nvim/lua/twright/[all other files] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("twright") | |
vim.cmd('source ' .. vim.env.VIMRUNTIME .. "/mswin.vim") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("twright.remap") | |
require("twright.set") | |
require("twright.lazy") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | |
if not vim.loop.fs_stat(lazypath) then | |
vim.fn.system({ | |
"git", | |
"clone", | |
"--filter=blob:none", | |
"https://github.com/folke/lazy.nvim.git", | |
"--branch=stable", -- latest stable release | |
lazypath, | |
}) | |
end | |
vim.opt.rtp:prepend(lazypath) | |
require("lazy").setup("twright.plugins") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return {{ | |
"rebelot/kanagawa.nvim", | |
lazy = false, -- make sure we load this during startup if it is your main colorscheme | |
priority = 1000, -- make sure to load this before all the other start plugins | |
config = function() | |
vim.cmd([[colorscheme kanagawa]]) | |
end, | |
},{ | |
"preservim/nerdtree", | |
config = function() | |
vim.keymap.set("n", "<C-k><C-b>", vim.cmd.NERDTreeToggle) | |
vim.keymap.set("i", "<C-k><C-b>", vim.cmd.NERDTreeToggle) | |
end, | |
},{ | |
'akinsho/toggleterm.nvim', | |
version = "*", | |
config = true, | |
config = function() | |
require('toggleterm').setup() | |
end | |
},{ | |
'vimwiki/vimwiki', | |
config = function() | |
vim.g.vimwiki_list = { | |
{ | |
path = '~/sequre-wiki', | |
nested_syntaxes = {python = 'python', ['c++'] = 'cpp'} | |
}, | |
} | |
end | |
},{ | |
'nvim-telescope/telescope.nvim', | |
dependencies = { | |
'nvim-lua/plenary.nvim', | |
'BurntSushi/ripgrep', | |
}, | |
config = function() | |
local builtin = require('telescope.builtin') | |
vim.keymap.set('n', '<leader>pf', builtin.find_files, {}) | |
vim.keymap.set('n', '<C-p>', builtin.git_files, {}) | |
vim.keymap.set('n', '<leader>ps', function() | |
builtin.grep_string({search = vim.fn.input("Grep > ")}) | |
end) | |
end | |
},{ | |
'nvim-treesitter/nvim-treesitter', | |
opts = { | |
run = ':TSUpdate', | |
} | |
},{ | |
'theprimeagen/harpoon', | |
config = function() | |
local mark = require("harpoon.mark") | |
local ui = require("harpoon.ui") | |
vim.keymap.set("n", "<leader>a", mark.add_file) | |
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu) | |
vim.keymap.set("n", "<C-1>", function() ui.nav_file(1) end) | |
vim.keymap.set("n", "<C-2>", function() ui.nav_file(2) end) | |
vim.keymap.set("n", "<C-3>", function() ui.nav_file(3) end) | |
vim.keymap.set("n", "<C-4>", function() ui.nav_file(4) end) | |
end | |
},{ | |
'mbbill/undotree', | |
config = function() | |
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle) | |
end | |
},{ | |
'tpope/vim-fugitive', | |
config = function() | |
vim.keymap.set("n", "<leader>gs", vim.cmd.Git) | |
end | |
},{ | |
'preservim/nerdcommenter', | |
config = function() | |
vim.g.NERDSpaceDelims = 1 | |
vim.g.NERDDefaultAlign = 'left' | |
-- Allow commenting and inverting empty lines (useful when commenting a region) | |
vim.g.NERDCommentEmptyLines = 1 | |
-- Enable trimming of trailing whitespace when uncommenting | |
vim.g.NERDTrimTrailingWhitespace = 1 | |
-- Enable NERDCommenterToggle to check all selected lines is commented or not | |
vim.g.NERDToggleCheckAllLines = 1 | |
-- Use alternate comment style | |
vim.g.NERDAltDelims_c = 1 | |
end, | |
},{ | |
'easymotion/vim-easymotion', | |
},{ | |
'preservim/tagbar', | |
config = function() | |
vim.keymap.set('n', '<F9>', ':TagbarOpen fj<CR>', {silent = true}) | |
end | |
},{ | |
'Raimondi/delimitMate', | |
config = function() | |
vim.g.delimitMate_expand_cr=1 | |
end | |
},{ | |
'neovim/nvim-lspconfig', | |
dependencies = { | |
'williamboman/mason.nvim', | |
'williamboman/mason-lspconfig.nvim', | |
}, | |
-- config = function() | |
-- (Optional) Configure lua language server for neovim | |
-- require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls()) | |
-- end | |
},{ -- Optional | |
'williamboman/mason.nvim', | |
config = function() | |
-- pcall(vim.cmd, 'MasonUpdate') | |
require('mason').setup({}) | |
end, | |
},{ | |
'williamboman/mason-lspconfig.nvim', | |
},{ | |
'hrsh7th/nvim-cmp' -- Required | |
},{ | |
'hrsh7th/cmp-nvim-lsp' | |
},{ | |
'L3MON4D3/LuaSnip' | |
},{ | |
'rust-lang/rust.vim', | |
ft = 'rust', | |
config = function() | |
vim.g.rustfmt_autosave = 1 | |
end | |
},{ | |
'VonHeikemen/lsp-zero.nvim', | |
dependencies = { | |
'neovim/nvim-lspconfig', | |
'williamboman/mason.nvim', | |
'williamboman/mason-lspconfig.nvim', | |
-- Autocompletion | |
'hrsh7th/nvim-cmp', | |
'hrsh7th/cmp-nvim-lsp', | |
'L3MON4D3/LuaSnip', | |
}, | |
config = function() | |
local lsp = require('lsp-zero').preset({}) | |
lsp.on_attach(function(client, bufnr) | |
lsp.default_keymaps({buffer = bufnr}) | |
end) | |
require('mason-lspconfig').setup({ | |
-- Replace the language servers listed here | |
-- with the ones you want to install | |
ensure_installed = {'tsserver', 'rust_analyzer'}, | |
handlers = { | |
lsp.default_setup, | |
}, | |
}) | |
lsp.setup() | |
-- You need to setup `cmp` after lsp-zero | |
local cmp = require('cmp') | |
local cmp_action = require('lsp-zero').cmp_action() | |
cmp.setup({ | |
mapping = { | |
-- `Enter` key to confirm completion | |
['<CR>'] = cmp.mapping.confirm({select = false}), | |
-- Ctrl+Space to trigger completion menu | |
['<C-Space>'] = cmp.mapping.complete(), | |
['<Tab>'] = cmp.mapping.select_next_item(), | |
['<S-Tab>'] = cmp.mapping.select_prev_item(), | |
-- Navigate between snippet placeholder | |
['<C-f>'] = cmp_action.luasnip_jump_forward(), | |
['<C-b>'] = cmp_action.luasnip_jump_backward(), | |
} | |
}) | |
end | |
}} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- key bindings and stuff | |
vim.g.mapleader = "," | |
-- " REQUIRED | |
vim.keymap.set("n", ";", ":", {noremap = true}) | |
vim.keymap.set('i', 'jk', '<Esc>') | |
vim.keymap.set('n', 'q;', 'q:', {noremap = true}) | |
vim.keymap.set('n', '<SPACE>', 'o<ESC>', {silent = true, noremap = true}) | |
-- Tagbar | |
vim.keymap.set('n', '<F9>', ':TagbarOpen fj<CR>', {silent = true}) | |
-- Toggle word wrap | |
vim.keymap.set('n', '<leader>w', ':set nowrap!<CR>', {silent = true, noremap = true}) | |
-- NERDTree | |
vim.keymap.set("n", "<C-k><C-b>", vim.cmd.NERDTreeToggle) | |
vim.keymap.set("i", "<C-k><C-b>", vim.cmd.NERDTreeToggle) | |
vim.keymap.set('n', '<leader>/', vim.cmd.nohl) | |
vim.keymap.set('n', '<leader>vs', vim.cmd.vs) | |
-- Turn search highlight off | |
vim.keymap.set('n', '<leader>/', vim.cmd.nohl, {noremap = true}) | |
-- Move around windows | |
vim.keymap.set('n', '<C-H>', '<C-W>h', {noremap = true}) | |
vim.keymap.set('n', '<C-J>', '<C-W>jkk', {noremap = true}) | |
vim.keymap.set('n', '<C-K>', '<C-W>k', {noremap = true}) | |
vim.keymap.set('n', '<C-L>', '<C-W>l', {noremap = true}) | |
-- Open new tab | |
vim.keymap.set('n', '<C-T>', vim.cmd.tabnew, {silent = true, noremap = true}) | |
-- Open new scratch buffer | |
-- nnoremap <C-N> :vnew <CR> | |
vim.keymap.set('n', '<C-N>', vim.cmd.vnew, {noremap = true}) | |
-- Move lines up/down with Alt jk | |
vim.keymap.set('n', '<A-j>', ':m .+1<CR>==', {silent = true, noremap = true}) | |
vim.keymap.set('n', '<A-k>', ':m .-2<CR>==', {silent = true, noremap = true}) | |
vim.keymap.set('i', '<A-j>', '<Esc>:m .+1<CR>==gi', {silent = true, noremap = true}) | |
vim.keymap.set('i', '<A-k>', '<Esc>:m .-2<CR>==gi', {silent = true, noremap = true}) | |
vim.keymap.set('v', '<A-k>', ':m <-2<CR>gv=gv', {silent = true, noremap = true}) | |
vim.keymap.set('v', '<A-j>', ':m >+1<CR>gv=gv', {silent = true, noremap = true}) | |
-- Fancy cursor movement | |
vim.keymap.set('n', '<leader>zt', 'zt8k8j', {silent = true, noremap = true}) | |
vim.keymap.set('n', '<leader>zb', 'zb8j8k', {silent = true, noremap = true}) | |
-- vertical split same file | |
vim.keymap.set('n', '<leader>vs', vim.cmd.vsplit, {noremap = true}) | |
-- Don't use Ex mode, use Q for formatting | |
vim.keymap.set('', 'Q', 'gq') | |
-- Remap VIM 0 to first non-blank character | |
vim.keymap.set('', '0', '^') | |
vim.api.nvim_command([[autocmd BufReadPost quickfix nnoremap <buffer> <CR> <CR>]]) | |
-- exit terminal mode | |
vim.keymap.set('t', 'ESC', '<C-\\><C-n>') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vim.opt.guicursor = "" | |
vim.g.loaded_netrw = 1 | |
vim.g.loaded_netrwPlugin = 1 | |
vim.opt.nu = true | |
-- vim.opt.relativenumber = true | |
vim.opt.tabstop = 4 | |
vim.opt.softtabstop = 4 | |
vim.opt.shiftwidth = 4 | |
vim.opt.expandtab = true | |
vim.opt.smartindent = true | |
vim.opt.wrap = false | |
vim.opt.swapfile = false | |
vim.opt.backup = false | |
print(vim.env.HOME) | |
vim.opt.undodir = vim.env.HOME.."/.vim/undodir" | |
vim.opt.undofile = true | |
vim.opt.hlsearch = true | |
vim.opt.incsearch = true | |
vim.opt.termguicolors = true | |
vim.opt.scrolloff = 8 | |
vim.opt.signcolumn = "yes" | |
vim.opt.isfname:append("@-@") | |
vim.opt.updatetime = 50 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment