initial neovim config
This commit is contained in:
49
init.lua
Normal file
49
init.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
vim.cmd("set ww=<,>,[,],h,l")
|
||||
vim.cmd("colorscheme slate")
|
||||
vim.cmd("set number")
|
||||
vim.cmd("set ruler")
|
||||
|
||||
vim.deprecate = function() end
|
||||
|
||||
-- Bootstrap lazy.nvim
|
||||
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",
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
-- Better syntax highlighting
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
},
|
||||
|
||||
-- Easy LSP config (works with pyright)
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
})
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.pyright.setup({})
|
||||
|
||||
require("nvim-treesitter.configs").setup({
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set('n', ' ', vim.lsp.buf.hover, {})
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
|
||||
vim.keymap.set('n', 'cd', vim.lsp.buf.rename, {})
|
||||
vim.keymap.set('n', 'g.', vim.lsp.buf.code_action, {})
|
||||
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float)
|
||||
|
||||
5
lazy-lock.json
Normal file
5
lazy-lock.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "e0fae251f8459940331960106d4bd9457cec23de" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }
|
||||
}
|
||||
1
pack/nvim/start/nvim-lspconfig
Submodule
1
pack/nvim/start/nvim-lspconfig
Submodule
Submodule pack/nvim/start/nvim-lspconfig added at 03bc581e05
Reference in New Issue
Block a user