diff --git a/.config/nvim/lua/user/keymaps.lua b/.config/nvim/lua/user/keymaps.lua new file mode 100644 index 0000000..b4d12c6 --- /dev/null +++ b/.config/nvim/lua/user/keymaps.lua @@ -0,0 +1,10 @@ +vim.g.mapleader = ' ' -- set as leader key + +vim.keymap.set('n', 'w', 'write') -- write file with leader w +vim.keymap.set('n', 'e', 'NvimTreeToggle') -- open file explorer with leader e + +-- set split navigation to cntrl+j/k/h/l +vim.keymap.set('n', '', 'j') +vim.keymap.set('n', '', 'k') +vim.keymap.set('n', '', 'h') +vim.keymap.set('n', '', 'l') diff --git a/.config/nvim/lua/user/options.lua b/.config/nvim/lua/user/options.lua new file mode 100644 index 0000000..4f303f8 --- /dev/null +++ b/.config/nvim/lua/user/options.lua @@ -0,0 +1,15 @@ +vim.g.loaded_netrw = 1 -- disable netrw for nvim-tree +vim.g.loaded_netrwPlugin = 1 -- recommended for nvim-tree +vim.opt.number = true -- turn line numbers on +vim.opt.ignorecase = true -- ignore case when searching +vim.opt.hlsearch = true -- highlight search results +vim.opt.tabstop = 2 -- set number of spaces for a tab +vim.opt.shiftwidth = 2 -- number of spaces a tab will be expanded to +vim.opt.expandtab = true -- enable expanding tabs to spaces +vim.opt.wrap = true -- softwrap long lines in view +vim.opt.breakindent = true -- indent wrapped lines +vim.opt.cursorline = true -- underline current line +vim.opt.cursorlineopt = "screenline" -- hightlight line only +vim.opt.termguicolors = true -- enables 24-bit color +vim.opt.splitbelow = true -- new horizontal splits go below +vim.opt.splitright = true -- new vertical splits go right diff --git a/.config/nvim/lua/user/plugins.lua b/.config/nvim/lua/user/plugins.lua new file mode 100644 index 0000000..aa52e3c --- /dev/null +++ b/.config/nvim/lua/user/plugins.lua @@ -0,0 +1,51 @@ +local ensure_packer = function() + local fn = vim.fn + local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' + if fn.empty(fn.glob(install_path)) > 0 then + fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) + vim.cmd [[packadd packer.nvim]] + return true + end + return false +end + +local packer_bootstrap = ensure_packer() + +return require('packer').startup(function(use) + use 'wbthomason/packer.nvim' + use { + 'williamboman/mason.nvim', + run = ':MasonUpdate' -- :MasonUpdate updates registry contents + } + use 'NvChad/nvim-colorizer.lua' + use 'windwp/nvim-autopairs' + use 'nvim-tree/nvim-tree.lua' + use 'nvim-tree/nvim-web-devicons' + use {'akinsho/bufferline.nvim', tag = "*", requires = 'nvim-tree/nvim-web-devicons'} +-- use {'neoclide/coc.nvim', branch = 'release'} + + -- Themes + use 'folke/tokyonight.nvim' + + -- Automatically set up your configuration after cloning packer.nvim + -- Put this at the end after all plugins + if packer_bootstrap then + require('packer').sync() + end + + -- mason setup + require 'mason'.setup() + + -- colorizer setup + require 'colorizer'.setup() + + -- autopairs setup + require 'nvim-autopairs'.setup() + + -- nvim-tree setup + require 'nvim-tree'.setup() + + -- bufferline setup + require 'bufferline'.setup() + +end)