commit 68cdad55fa9b61aebf36e14a08b0482ebfd55f1e
parent 672780d51eb11291039f34a60615c3d6aa81757e
Author: MichaĆ M. Sapka <michal@sapka.me>
Date: Mon, 4 Apr 2022 17:18:04 +0200
Add Packer
Diffstat:
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/nvim/init.lua b/nvim/init.lua
@@ -1,4 +1,4 @@
-# General options
+-- General options
vim.opt.backup = false
vim.opt.swapfile = false
@@ -7,3 +7,34 @@ vim.opt.number = true
vim.opt.hlsearch = true
vim.opt.ignorecase = true
+
+-- Keymaps
+opts = { noremap = true }
+vim.api.nvim_set_keymap("n", "<C-h>", "<C-w>h", opts)
+vim.api.nvim_set_keymap("n", "<C-j>", "<C-w>k", opts)
+vim.api.nvim_set_keymap("n", "<C-k>", "<C-w>k", opts)
+vim.api.nvim_set_keymap("n", "<C-l>", "<C-w>l", opts)
+
+-- Plugins
+local vim = vim
+local execute = vim.api.nvim_command
+local fn = vim.fn
+-- ensure that packer is installed
+local install_path = fn.stdpath('data')..'/site/pack/packer/opt/packer.nvim'
+if fn.empty(fn.glob(install_path)) > 0 then
+ execute('!git clone https://github.com/wbthomason/packer.nvim '..install_path)
+ execute 'packadd packer.nvim'
+end
+vim.cmd('packadd packer.nvim')
+local packer = require'packer'
+local util = require'packer.util'
+packer.init({
+ package_root = util.join_paths(vim.fn.stdpath('data'), 'site', 'pack')
+})
+--- startup and add configure plugins
+packer.startup(function()
+ local use = use
+ -- add you plugins here like:
+ -- use 'neovim/nvim-lspconfig'
+ end
+)