Created
November 4, 2023 14:57
-
-
Save eterps/b191ca1660f1bb451573fc4fbb2b7c0f to your computer and use it in GitHub Desktop.
Starter neovim configuration
This file contains hidden or 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) | |
vim.g.mapleader = ',' | |
vim.opt.mouse = '' -- disable mouse and right context menu | |
vim.opt.titlestring = '%t' | |
vim.opt.shiftwidth = 2 -- size of an indent | |
vim.opt.tabstop = 4 -- tab character should appear 4 spaces wide | |
vim.opt.number = true -- display line numbers | |
vim.opt.expandtab = true -- convert tabs to whitespace | |
vim.opt.splitbelow = true -- put new windows below current | |
vim.opt.splitright = true -- put new windows right of current | |
local map = vim.api.nvim_set_keymap | |
map('n', '<esc>', ':nohlsearch<cr>', { noremap = true, silent = true }) | |
-- Window navigation | |
map('n', '<A-Left>', '<C-w>h', { noremap = true }) | |
map('n', '<A-Down>', '<C-w>j', { noremap = true }) | |
map('n', '<A-Up>', '<C-w>k', { noremap = true }) | |
map('n', '<A-Right>', '<C-w>l', { noremap = true }) | |
require('lazy').setup({ | |
{ | |
'folke/tokyonight.nvim', | |
opts = { style = 'night', transparent = true }, | |
init = function() | |
vim.cmd.colorscheme 'tokyonight' | |
end, | |
}, | |
{ | |
'nvim-treesitter/nvim-treesitter', | |
build = ':TSUpdate', | |
config = function() | |
require('nvim-treesitter.configs').setup({ | |
auto_install = true, | |
indent = { enable = true }, | |
highlight = { enable = true }, | |
}) | |
end, | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment