added additional nvim config files

This commit is contained in:
Mike G 2023-11-09 20:26:25 -05:00
parent 21d3fb4507
commit 1a196c5d2d
3 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,10 @@
vim.g.mapleader = ' ' -- set <SPACE> as leader key
vim.keymap.set('n', '<leader>w', '<cmd>write<cr>') -- write file with leader w
vim.keymap.set('n', '<leader>e', '<cmd>NvimTreeToggle<cr>') -- open file explorer with leader e
-- set split navigation to cntrl+j/k/h/l
vim.keymap.set('n', '<C-j>', '<C-w>j')
vim.keymap.set('n', '<C-k>', '<C-w>k')
vim.keymap.set('n', '<C-h>', '<C-w>h')
vim.keymap.set('n', '<C-l>', '<C-w>l')

View file

@ -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

View file

@ -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)