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)
|
||||
|
||||
Reference in New Issue
Block a user