2022-06-02 18:55:00 +00:00
|
|
|
----------------------------------------------------------------------
|
|
|
|
--
|
|
|
|
-- NeoVim Configuration
|
|
|
|
--
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
-- Make searching case insensitive by default. Case sensitivity can be
|
|
|
|
-- enabled per search by including '\C' anywhere in the search term.
|
|
|
|
vim.opt.ignorecase = true
|
|
|
|
|
|
|
|
-- Enable line numbers.
|
|
|
|
vim.opt.number = true
|
|
|
|
|
|
|
|
-- Number of visual spaces a tab character counts for.
|
|
|
|
vim.opt.tabstop = 4
|
|
|
|
|
|
|
|
-- Number of spaces to insert when hitting tab.
|
|
|
|
vim.opt.softtabstop = 4
|
|
|
|
|
|
|
|
-- Insert spaces when pressing tab.
|
|
|
|
vim.opt.expandtab = true
|
|
|
|
|
|
|
|
-- Number of spaces to indent with '>>' and '<<'
|
|
|
|
vim.opt.shiftwidth = 4
|
|
|
|
|
|
|
|
-- Display invisible characters (tabs, trailing whitespace, etc.).
|
|
|
|
vim.opt.list = true
|
|
|
|
|
2024-02-27 17:17:49 +00:00
|
|
|
-- Disable mouse mode completely, so we can select text using the
|
|
|
|
-- mouse from withint tmux.
|
|
|
|
vim.opt.mouse = ''
|
|
|
|
|
2022-11-18 16:05:32 +00:00
|
|
|
vim.g.mapleader = " "
|
|
|
|
|
2024-02-27 17:19:05 +00:00
|
|
|
-- Always show 8 lines above or below the cursor when scrolling.
|
|
|
|
vim.opt.scrolloff = 8
|
|
|
|
|
2022-06-02 18:55:00 +00:00
|
|
|
-- ----------------------------------
|
|
|
|
-- Filetype configurations
|
|
|
|
-- ----------------------------------
|
|
|
|
|
|
|
|
vim.cmd [[
|
|
|
|
filetype plugin on
|
|
|
|
]]
|
|
|
|
|
|
|
|
local lua_augroup = vim.api.nvim_create_augroup('filetype_lua', {clear = true})
|
|
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
|
|
pattern = 'lua',
|
|
|
|
group = lua_augroup,
|
|
|
|
command = 'setlocal tabstop=2|setlocal shiftwidth=2|setlocal softtabstop=2'
|
|
|
|
})
|
|
|
|
|
|
|
|
local c_augroup = vim.api.nvim_create_augroup('filetype_c', {clear = true})
|
|
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
|
|
pattern = 'c',
|
|
|
|
group = c_augroup,
|
|
|
|
command = 'setlocal noexpandtab|setlocal tabstop=4'
|
|
|
|
})
|
|
|
|
|
|
|
|
local go_augroup = vim.api.nvim_create_augroup('filetype_go', {clear = true})
|
|
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
|
|
pattern = 'go',
|
|
|
|
group = go_augroup,
|
|
|
|
command = 'setlocal noexpandtab|setlocal tabstop=4'
|
|
|
|
})
|
|
|
|
|
|
|
|
local markdown_augroup = vim.api.nvim_create_augroup('filetype_markdown', {clear = true})
|
|
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
|
|
pattern = 'markdown',
|
|
|
|
group = markdown_augroup,
|
2022-08-03 14:52:03 +00:00
|
|
|
command = 'setlocal tabstop=2|setlocal shiftwidth=2|setlocal softtabstop=2|setlocal textwidth=80'
|
|
|
|
})
|
|
|
|
|
|
|
|
local html_augroup = vim.api.nvim_create_augroup('filetype_html', {clear = true})
|
|
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
|
|
pattern = 'html|htmldjango',
|
|
|
|
group = html_augroup,
|
2022-06-02 18:55:00 +00:00
|
|
|
command = 'setlocal tabstop=2|setlocal shiftwidth=2|setlocal softtabstop=2'
|
|
|
|
})
|
|
|
|
|
|
|
|
local txt_augroup = vim.api.nvim_create_augroup('filetype_txt', {clear = true})
|
|
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
|
|
pattern = 'text',
|
|
|
|
group = txt_augroup,
|
|
|
|
command = 'setlocal tabstop=3|setlocal shiftwidth=3|setlocal softtabstop=3|setlocal tw=72'
|
|
|
|
})
|
|
|
|
|
2024-02-27 17:09:33 +00:00
|
|
|
local json_augroup = vim.api.nvim_create_augroup('filetype_json', {clear = true})
|
|
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
|
|
pattern = 'json',
|
|
|
|
group = json_augroup,
|
|
|
|
command = 'setlocal tabstop=2|setlocal shiftwidth=2|setlocal softtabstop=2'
|
|
|
|
})
|
|
|
|
|
2024-02-27 17:09:47 +00:00
|
|
|
local asciidoc_augroup = vim.api.nvim_create_augroup('filetype_asciidoc', {clear = true})
|
|
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
|
|
pattern = 'asciidoc',
|
|
|
|
group = asciidoc_augroup,
|
|
|
|
command = 'setlocal tabstop=2|setlocal shiftwidth=2|setlocal softtabstop=2|setlocal tw=72|setlocal spell|setlocal spelllang=nl'
|
|
|
|
})
|
|
|
|
|
2022-06-02 18:55:00 +00:00
|
|
|
-- ----------------------------------
|
|
|
|
-- Plugins
|
|
|
|
-- ----------------------------------
|
|
|
|
|
|
|
|
local Plug = vim.fn["plug#"]
|
|
|
|
|
|
|
|
vim.call("plug#begin", "~/.config/nvim/plugged")
|
|
|
|
|
2024-02-27 17:12:35 +00:00
|
|
|
Plug('nvim-lua/plenary.nvim') -- Requirement for telescope.
|
|
|
|
Plug('nvim-telescope/telescope.nvim', {tag = '0.1.5' })
|
2022-06-02 18:55:00 +00:00
|
|
|
Plug('numToStr/Comment.nvim')
|
|
|
|
Plug('junegunn/fzf')
|
|
|
|
Plug('arcticicestudio/nord-vim')
|
2022-11-18 16:28:12 +00:00
|
|
|
Plug('mcchrish/nnn.vim')
|
2022-11-21 07:06:44 +00:00
|
|
|
Plug('editorconfig/editorconfig-vim')
|
|
|
|
Plug('lukas-reineke/indent-blankline.nvim')
|
2023-02-28 18:37:33 +00:00
|
|
|
Plug('sheerun/vim-polyglot')
|
2023-07-24 06:57:01 +00:00
|
|
|
Plug('catppuccin/nvim', {as = 'catppuccin'})
|
2022-06-02 18:55:00 +00:00
|
|
|
|
|
|
|
vim.call("plug#end")
|
|
|
|
|
2023-07-24 06:57:01 +00:00
|
|
|
-- Colorscheme
|
|
|
|
-- ------------------
|
|
|
|
|
|
|
|
vim.cmd("colorscheme catppuccin-mocha")
|
|
|
|
|
2022-06-02 18:55:00 +00:00
|
|
|
-- Comment
|
|
|
|
-- ------------------
|
|
|
|
|
|
|
|
require("Comment").setup()
|
|
|
|
|
|
|
|
-- FZF
|
|
|
|
-- ------------------
|
|
|
|
vim.cmd("nnoremap <C-p> :FZF<CR>")
|
2022-11-18 16:28:12 +00:00
|
|
|
|
2024-02-27 17:12:35 +00:00
|
|
|
-- Telescope
|
|
|
|
-- ------------------
|
|
|
|
local builtin = require('telescope.builtin')
|
|
|
|
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
|
|
|
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
|
|
|
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
|
|
|
|
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
|
|
|
|
2022-11-18 16:28:12 +00:00
|
|
|
-- nnn
|
|
|
|
-- ------------------
|
|
|
|
|
|
|
|
require("nnn").setup({
|
|
|
|
command = "nnn -o -C",
|
|
|
|
set_default_mappings = 0,
|
|
|
|
replace_netrw = 1,
|
|
|
|
})
|
|
|
|
|
|
|
|
vim.api.nvim_set_keymap("n", "<leader>o", ":NnnPicker %:p:h<CR>", {noremap=true})
|
|
|
|
vim.cmd("let g:nnn#session = 'global'")
|
2022-11-21 07:06:44 +00:00
|
|
|
|
|
|
|
-- indent-blankline
|
|
|
|
-- ------------------
|
|
|
|
|
2024-02-27 17:10:58 +00:00
|
|
|
require('ibl').setup()
|