Initial check in
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
*~
|
||||||
|
/plugin
|
||||||
|
/doc/neovim/.obsidian
|
||||||
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
| Environment variable | Path |
|
||||||
|
| :- | :- |
|
||||||
|
|XDG_CONFIG_HOME| z:\\home\\.config|
|
||||||
|
|XDG_DATA_HOME|z:\\home\\.data|
|
||||||
|
|
||||||
|
### Folder structure
|
||||||
|
|
||||||
|
~/.config/nvim
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
|
require( "roka.core.options")
|
||||||
|
require( "roka.core.keymaps")
|
||||||
|
require( "roka.core.plugins")
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
local keymap = vim.keymap
|
||||||
|
|
||||||
|
-- Modes
|
||||||
|
--
|
||||||
|
-- "n" = normal mode
|
||||||
|
-- "i" = insert mode
|
||||||
|
-- "v" = visual mode
|
||||||
|
-- "x" = visual block mode
|
||||||
|
-- "t" = term mode
|
||||||
|
-- "c" = command mode
|
||||||
|
--
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
-- Normal
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
-- Window splitting
|
||||||
|
keymap.set( "n", "<leader>sv", "<C-w>v" ) -- split widow vertically
|
||||||
|
keymap.set( "n", "<leader>sh", "<C-w>s" ) -- split widow horizontaly
|
||||||
|
keymap.set( "n", "<leader>se", "<C-w>=" ) -- make split windows equal width
|
||||||
|
keymap.set( "n", "<leader>sx", ":close<CR>" ) -- close window
|
||||||
|
keymap.set( "n", "<leader>sm", ":MaximizerToggle<CR>" )
|
||||||
|
|
||||||
|
-- Window navigation
|
||||||
|
keymap.set( "n", "<C-h>", "<C-w>h")
|
||||||
|
keymap.set( "n", "<C-j>", "<C-w>j")
|
||||||
|
keymap.set( "n", "<C-k>", "<C-w>k")
|
||||||
|
keymap.set( "n", "<C-l>", "<C-w>l")
|
||||||
|
|
||||||
|
-- Resize window with arrows
|
||||||
|
keymap.set( "n", "<C-Left>", ":vertical resize -2<cr>")
|
||||||
|
keymap.set( "n", "<C-Right>", ":vertical resize +2<cr>")
|
||||||
|
keymap.set( "n", "<C-Up>", ":resize +2<cr>")
|
||||||
|
keymap.set( "n", "<C-Down>", ":resize -2<cr>")
|
||||||
|
|
||||||
|
-- keymap.set( "n", "<leader>e", ":Lex 30 <cr>")
|
||||||
|
|
||||||
|
-- Buffers
|
||||||
|
keymap.set( "n", "<S-l>", ":bnext<cr>" ) -- next buffer
|
||||||
|
keymap.set( "n", "<S-h>", ":bprevious<cr>" ) -- prev buffer
|
||||||
|
keymap.set( "n", "<C-w>", ":bd<CR>" ) -- delete buffer
|
||||||
|
|
||||||
|
-- TABs
|
||||||
|
keymap.set( "n", "<leader>to", ":tabnew<CR>" ) -- open new tab
|
||||||
|
keymap.set( "n", "<leader>tx", ":tabclose<CR>" ) -- close current tab
|
||||||
|
keymap.set( "n", "<leader>tn", ":tabn<CR>" ) -- go to next tab
|
||||||
|
keymap.set( "n", "<leader>tp", ":tabp<CR>" ) -- go to prev tab
|
||||||
|
|
||||||
|
-- diagnostic warning/error navigation
|
||||||
|
keymap.set( "n", "g[", vim.diagnostic.goto_prev)
|
||||||
|
keymap.set( "n", "g]", vim.diagnostic.goto_next)
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
-- Insert mode
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
keymap.set("i", "jk", "<ESC>")
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
-- Visual mode
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
-- Stay in indent mode
|
||||||
|
keymap.set("v", "<", "<gv")
|
||||||
|
keymap.set("v", ">", ">gv")
|
||||||
|
|
||||||
|
-- Visual Block --
|
||||||
|
keymap.set("v", "<A-j>", ":m .+1<CR>==")
|
||||||
|
keymap.set("v", "<A-k>", ":m .-2<CR>==")
|
||||||
|
keymap.set("v", "p", '"_dP')
|
||||||
|
|
||||||
|
-- Move text up and down
|
||||||
|
keymap.set( "x", "J", ":move '>+1<CR>gv-gv")
|
||||||
|
keymap.set( "x", "K", ":move '<-2<CR>gv-gv")
|
||||||
|
keymap.set( "x", "<A-j>", ":move '>+1<CR>gv-gv")
|
||||||
|
keymap.set( "x", "<A-k>", ":move '<-2<CR>gv-gv")
|
||||||
|
|
||||||
|
|
||||||
|
-- Terminal --
|
||||||
|
-- Better terminal navigation
|
||||||
|
keymap.set( "t", "<C-h>", "<C-\\><C-N><C-w>h")
|
||||||
|
keymap.set( "t", "<C-j>", "<C-\\><C-N><C-w>j")
|
||||||
|
keymap.set( "t", "<C-k>", "<C-\\><C-N><C-w>k")
|
||||||
|
keymap.set( "t", "<C-l>", "<C-\\><C-N><C-w>l")
|
||||||
|
|
||||||
|
keymap.set("n", "<leader>nh", ":nohl<CR>")
|
||||||
|
keymap.set("n", "x", '"_x"')
|
||||||
|
|
||||||
|
keymap.set("n", "<C-TAB>", ":tabn<CR>") -- go to next tab
|
||||||
|
keymap.set("n", "<C-S-TAB>", ":tabp<CR>") -- go to prev tab
|
||||||
|
-- plugin keymaps
|
||||||
|
|
||||||
|
-- nvim-tree
|
||||||
|
keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>")
|
||||||
|
|
||||||
|
-- telescope
|
||||||
|
keymap.set("n", "<leader>ff", ":Telescope find_files<cr>" )
|
||||||
|
keymap.set("n", "<leader>fs", ":Telescope live_grep<cr>" )
|
||||||
|
keymap.set("n", "<leader>fc", ":Telescope grep_string<cr>")
|
||||||
|
keymap.set("n", "<leader>fb", ":Telescope buffers<cr>" )
|
||||||
|
keymap.set("n", "<leader>fh", ":Telescope help_tags<cr>" )
|
||||||
|
|
||||||
|
keymap.set("n", "<leader>x", "<cmd>lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))<cr>")
|
||||||
|
keymap.set("n", "<c-t>", "<cmd>Telescope live_grep<cr>")
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
local opt = vim.opt
|
||||||
|
|
||||||
|
-- [[ Font ]]
|
||||||
|
--opt.guifont = { "SauceCodePro NF:h11:r:#e-subpixelantialias:#h-none" }
|
||||||
|
--opt.guifont = { "BlexMono NFM:h11:l:i:#e-subpixelantialias:#h-none" }
|
||||||
|
opt.guifont = { "BlexMono NFM:h11:l:#e-subpixelantialias:#h-none" }
|
||||||
|
|
||||||
|
-- [[ Context ]]
|
||||||
|
opt.number = true -- set numbered lines
|
||||||
|
opt.relativenumber = true -- show relative numbers
|
||||||
|
opt.numberwidth = 4 -- set line number column width to 4
|
||||||
|
opt.colorcolumn = '100' -- show color for max line length
|
||||||
|
|
||||||
|
-- [[ Whitespace ]]
|
||||||
|
opt.expandtab = true -- convert tabs to spaces
|
||||||
|
opt.shiftwidth = 4 -- size of an indent
|
||||||
|
opt.softtabstop = 4 -- number of spaces tabs count for in insert mode
|
||||||
|
opt.tabstop = 4 -- number of spaces tabs count for
|
||||||
|
|
||||||
|
opt.autoindent = true
|
||||||
|
|
||||||
|
-- [[ Filetypes ]]
|
||||||
|
opt.encoding = 'utf8' -- string encoding
|
||||||
|
opt.fileencoding = 'utf8' -- file encoding
|
||||||
|
|
||||||
|
-- [[ Theme ]]
|
||||||
|
opt.syntax = 'ON' -- allow syntax highlighting
|
||||||
|
opt.termguicolors = true -- set term gui colors (most terminals support this)
|
||||||
|
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
-- line wrapping
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
opt.wrap = false -- display lines as one long line
|
||||||
|
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
-- search settings
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
-- [[ Search ]]
|
||||||
|
opt.ignorecase = true -- ignore case in search patterns
|
||||||
|
opt.smartcase = true -- override ignorecase if search contains capital
|
||||||
|
opt.incsearch = true -- use incremental search
|
||||||
|
opt.hlsearch = true -- highlight search matches
|
||||||
|
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
-- cursor line
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
opt.cursorline = false -- highlight the current line
|
||||||
|
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
-- appearance
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
opt.background = "dark"
|
||||||
|
opt.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time
|
||||||
|
opt.scrolloff = 4 -- is one of my fav
|
||||||
|
opt.sidescrolloff = 4 -- The minimal number of screen columns to keep
|
||||||
|
opt.cmdheight = 1 -- more space in the neovim command line for displaying messages
|
||||||
|
|
||||||
|
vim.cmd([[
|
||||||
|
set noshowmode
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
-- backspace
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
opt.backspace = "indent,eol,start"
|
||||||
|
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
-- split windows
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
-- [[ Splits ]]
|
||||||
|
opt.splitright = true -- place new window to right of current one
|
||||||
|
opt.splitbelow = true -- place new window below the current one
|
||||||
|
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
-- AutoCompletion
|
||||||
|
--
|
||||||
|
-- set the completeopt to have a better completion experience
|
||||||
|
-- :help completeopt
|
||||||
|
--
|
||||||
|
-- menuone : popup even when there's only one match
|
||||||
|
-- noinsert : do not insert text until a selection is made
|
||||||
|
-- noselect : do not select, force to select one from the menu
|
||||||
|
-- shortmess : avoid showing extra messages when using completion
|
||||||
|
-- updatetime : set updatetime for CursorHold
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
opt.completeopt = {'menuone', 'noselect', 'noinsert'}
|
||||||
|
opt.shortmess = opt.shortmess + { c = true}
|
||||||
|
opt.updatetime = 100
|
||||||
|
--vim.api.nvim_set_option( 'updatetime', 300)
|
||||||
|
|
||||||
|
-- fixed column for diagnostic to appear
|
||||||
|
-- show autodiagnostic popup on cursor hover_range
|
||||||
|
-- goto previous/next diagnostic warning/error
|
||||||
|
-- show inlay_hints more frequently
|
||||||
|
vim.cmd([[
|
||||||
|
set signcolumn=yes
|
||||||
|
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
|
||||||
|
]])
|
||||||
|
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
-- clipboard
|
||||||
|
-- ------------------------------------------------------------------------------------------------
|
||||||
|
opt.clipboard:append("unnamedplus") -- allows neovim to access the system clipboard
|
||||||
|
opt.iskeyword:append("-")
|
||||||
|
|
||||||
|
--vim.g.neovide_cursor_vfx_mode = ""
|
||||||
|
--vim.g.neovide_cursor_animation_length = 0
|
||||||
|
--vim.g.neovide_transparency = 1.0
|
||||||
|
--vim.g.neovide_remember_window_size = true
|
||||||
|
---- vim.g.neovide_profiler =false
|
||||||
|
--vim.g.neovide_scroll_animation_length = 0.0
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
local fn = vim.fn
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
-- Automatically install packer
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim"
|
||||||
|
|
||||||
|
if fn.empty(fn.glob(install_path)) > 0 then
|
||||||
|
PACKER_BOOTSTRAP = fn.system {
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--depth",
|
||||||
|
"1",
|
||||||
|
"https://github.com/wbthomason/packer.nvim",
|
||||||
|
install_path,
|
||||||
|
}
|
||||||
|
|
||||||
|
print "Installing packer. Close and reopen Neovim..."
|
||||||
|
|
||||||
|
vim.cmd [[
|
||||||
|
packadd packer.nvim
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
-- Autocommand that reloads neovim whenever you save the plugins.lua file
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
vim.cmd [[
|
||||||
|
augroup packer_user_config
|
||||||
|
autocmd!
|
||||||
|
autocmd BufWritePost plugins.lua source <afile> | PackerSync
|
||||||
|
augroup end
|
||||||
|
]]
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
-- Use a protected call so we don't error out on first use
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
local status, packer = pcall(require, "packer")
|
||||||
|
if not status then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
-- Have packer use a popup window
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
packer.init {
|
||||||
|
display = {
|
||||||
|
open_fn = function()
|
||||||
|
return require("packer.util").float { border = "rounded" }
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
-- Install plugins
|
||||||
|
-- ----------------------------------------------------------------------------
|
||||||
|
return packer.startup(function(use)
|
||||||
|
|
||||||
|
-- ------------------------------------------------------
|
||||||
|
-- Have packer manage itself
|
||||||
|
-- ------------------------------------------------------
|
||||||
|
use "wbthomason/packer.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
|
||||||
|
end)
|
||||||
Reference in New Issue
Block a user