diff options
Diffstat (limited to '.config/nvim/lua/user')
-rw-r--r-- | .config/nvim/lua/user/beautiful.lua | 6 | ||||
-rw-r--r-- | .config/nvim/lua/user/options.lua | 35 | ||||
-rw-r--r-- | .config/nvim/lua/user/plugins.lua | 35 | ||||
-rw-r--r-- | .config/nvim/lua/user/remaps.lua | 58 |
4 files changed, 134 insertions, 0 deletions
diff --git a/.config/nvim/lua/user/beautiful.lua b/.config/nvim/lua/user/beautiful.lua new file mode 100644 index 0000000..17b7ed5 --- /dev/null +++ b/.config/nvim/lua/user/beautiful.lua @@ -0,0 +1,6 @@ +-- this file contains configuration for colorschemes e.t.c + +local colorscheme = "habamax" +-- local colorscheme = "evening" +vim.cmd("colo " .. colorscheme) + diff --git a/.config/nvim/lua/user/options.lua b/.config/nvim/lua/user/options.lua new file mode 100644 index 0000000..a8e58bc --- /dev/null +++ b/.config/nvim/lua/user/options.lua @@ -0,0 +1,35 @@ +-- this file contains general options for nvim + +local o = vim.opt + +local options = { + -- general options + backup = false, + clipboard = "unnamedplus", + cmdheight = 1, + conceallevel = 0, + fileencoding = "utf-8", + hlsearch = true, + mouse = "a", + showmode = true, + tabstop = 8, + shiftwidth = 8, + smartindent = true, + swapfile = false, + timeoutlen = 1000, --ms + updatetime = 300, + writebackup = false, + expandtab = false, -- !!!!!!!!! + cursorline = false, + number = true, + wrap = false, + -- splitting + splitbelow = true, + splitright = true, +} + +for key, val in pairs(options) do + o[key] = val +end + +-- vim.cmd('colo evening') diff --git a/.config/nvim/lua/user/plugins.lua b/.config/nvim/lua/user/plugins.lua new file mode 100644 index 0000000..2344087 --- /dev/null +++ b/.config/nvim/lua/user/plugins.lua @@ -0,0 +1,35 @@ +-- this file contains plugin settings as well as initialization of lazy.nvim + + +-- plugins to be installed +plugins = { + "folke/lazy.nvim", -- plugin manager + "folke/which-key.nvim", -- pretty self-descriptive name + "rafi/awesome-vim-colorschemes", -- same here + "tpope/vim-commentary" -- gc & gcc for commenting +} + +-- options for lazy +opts = { + +} + + +-- some lazy.nvim magic +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) + +-- initialization +lazy = require("lazy") +lazy.setup(plugins, opts) + diff --git a/.config/nvim/lua/user/remaps.lua b/.config/nvim/lua/user/remaps.lua new file mode 100644 index 0000000..742e967 --- /dev/null +++ b/.config/nvim/lua/user/remaps.lua @@ -0,0 +1,58 @@ +-- this file contains general remappings for this nvim configuration + +local opt = { noremap = true, silent = true } + +local map = vim.api.nvim_set_keymap + +map("", "\\", "<Nop>", opt) +vim.g.mapleader = "\\" + +-- some minor commands +map("c", "w!!", "w !sudo tee % > /dev/null", opt) + +-- remap j and k +-- i refuse to elaborate +map("n", "j", "<Up>", opt) +map("n", "k", "<Down>", opt) + +-- window navigation +map("n", "<C-l>", "<C-w>l", opt) +map("n", "<C-j>", "<C-w>k", opt) -- SWITCHED K AND J +map("n", "<C-k>", "<C-w>j", opt) -- SWITCHED K AND J +map("n", "<C-h>", "<C-w>h", opt) + +-- Insert mode navigation +map("i", "<C-h>", "<Left>", opt) +map("i", "<C-j>", "<Up>", opt) -- SWITCHED K AND J +map("i", "<C-k>", "<Down>", opt) -- SWITCHED K AND J +map("i", "<C-l>", "<Right>", opt) + +-- lexer options..? +map("n", "<leader>e", ":Lex 49<cr>", opt) + +-- resizing options +map("n", "<C-Left>", ":vertical resize -5<cr>", opt) +map("n", "<C-Up>", ":resize +5<cr>", opt) +map("n", "<C-Right>", ":vertical resize +5<cr>", opt) +map("n", "<C-Down>", ":resize -5<cr>", opt) + +-- better indentation +map("v", "<", "<gv", opt) +map("v", ">", ">gv", opt) + +-- moving lines +map("n", "<A-j>", ":m .-2<CR>==", opt) -- SWITCHED K AND J +map("n", "<A-k>", ":m .+1<CR>==", opt) -- SWITCHED K AND J + +-- duplicating lines +map("n", "<C-Up>", ":.,.t.-1<CR>==", opt) +map("n", "<C-Down>", ":.,.t.<CR>==", opt) + +-- leader remaps +map("n", "<leader>/", ":nohlsearch<CR>", opt) -- discard search highlighting +map("n", "<leader>T", ":term<CR>", opt) -- open terminal fullscreen with \T +map("n", "<leader>t", ":vsplit term <CR>", opt) -- split to terminal with \t +map("n", "<leader>pl", ":Lazy<CR>", opt) -- open plugin manager + +-- miscellaneous +map("n", "<leader>relaod", ":luafile ~/.config/nvim/lua/init.lua", {noremap = false}) |