aboutsummaryrefslogtreecommitdiffstats
path: root/.config
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.config/nvim/coc-settings.json48
-rw-r--r--.config/nvim/init.lua362
-rw-r--r--.config/nvim/lua/coc.lua191
-rw-r--r--.config/nvim/lua/keys.lua54
-rw-r--r--.config/nvim/lua/look.lua69
-rw-r--r--.config/nvim/lua/opts.lua47
-rw-r--r--.config/nvim/lua/plug.lua20
-rw-r--r--.config/nvim/lua/tele.lua29
-rw-r--r--.config/nvim/lua/tree.lua32
-rw-r--r--.config/nvim/lua/zen.lua16
10 files changed, 350 insertions, 518 deletions
diff --git a/.config/nvim/coc-settings.json b/.config/nvim/coc-settings.json
deleted file mode 100644
index a453996..0000000
--- a/.config/nvim/coc-settings.json
+++ /dev/null
@@ -1,48 +0,0 @@
-{
- "suggest.noselect": true,
- "languageserver": {
- "haskell": {
- "command": "haskell-language-server-wrapper",
- "args": [
- "--lsp"
- ],
- "rootPatterns": [
- "*.cabal",
- "stack.yaml",
- "cabal.project",
- "package.yaml",
- "hie.yaml"
- ],
- "filetypes": [
- "haskell",
- "lhaskell"
- ],
- "settings": {
- "haskell": {
- "checkParents": "CheckOnSave",
- "checkProject": true,
- "maxCompletions": 40,
- "formattingProvider": "ormolu",
- "plugin": {
- "stan": {
- "globalOn": true
- }
- }
- }
- }
- },
- "dockerfile": {
- "command": "docker-langserver",
- "filetypes": [
- "dockerfile"
- ],
- "args": [
- "--stdio"
- ]
- }
- },
- "coc.source.vimtex.filetypes": [
- "tex",
- "plaintex"
- ],
-}
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index eed786b..b7f2e5a 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -1,12 +1,350 @@
--- init.lua
-require('coc')
-require('keys')
-require('look')
-require('opts')
-require('plug')
-require('tele')
-require('tree')
-require('zen')
-
--- enable spellcheck
-vim.cmd('setlocal spelllang=en_us,tl') -- english(us) and filipino(tagalog)
+-- leader
+vim.g.mapleader = " "
+
+-- plugins
+vim.cmd [[
+ call plug#begin()
+ Plug 'https://github.com/preservim/nerdtree', { 'on': 'NERDTreeToggle' }
+ Plug 'tmsvg/pear-tree'
+ Plug 'https://github.com/adelarsq/vim-matchit'
+ Plug 'tpope/vim-surround'
+ Plug 'sbdchd/neoformat'
+ Plug 'ThePrimeagen/vim-be-good'
+ Plug 'junegunn/fzf'
+ Plug 'nvim-lua/plenary.nvim'
+ Plug 'nvim-telescope/telescope.nvim', { 'branch': '0.1.x' }
+ Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
+ Plug 'Pocco81/true-zen.nvim'
+ Plug 'neovim/nvim-lspconfig'
+ Plug 'williamboman/mason.nvim'
+ Plug 'williamboman/mason-lspconfig.nvim'
+ Plug 'WhoIsSethDaniel/mason-tool-installer.nvim'
+ Plug 'j-hui/fidget.nvim'
+ call plug#end()
+]]
+
+local opts = {
+ autochdir = true,
+ autoindent = true,
+ backup = false,
+ cursorline = true,
+ expandtab = true,
+ hlsearch = true,
+ ignorecase = true,
+ linebreak = true,
+ listchars = { tab = ">-", trail = "~", extends = ">", precedes = "<", space = "." },
+ mouse = "a",
+ number = true,
+ relativenumber = true,
+ shiftwidth = 4,
+ showmatch = true,
+ signcolumn = "yes",
+ smartcase = true,
+ softtabstop = 4,
+ splitbelow = true,
+ splitright = true,
+ tabstop = 4,
+ termguicolors = true,
+ ttimeout = true,
+ ttimeoutlen = 1,
+ ttyfast = true,
+ undofile = true,
+ updatetime = 300,
+ writebackup = false,
+}
+
+-- options
+for k, v in pairs(opts) do
+ vim.opt[k] = v
+end
+
+-- spell and cursor shape
+vim.opt.spelllang = { "en_us", "tl" }
+vim.g.t_SI = "\27[6 q"
+vim.g.t_EI = "\27[2 q"
+
+-- terminal tweaks
+if vim.env.TERM == "alacritty" then
+ vim.opt.ttymouse = "sgr"
+end
+
+-- keymaps
+local keymap = vim.keymap.set
+
+keymap("v", "<C-c>", '"+y', { noremap = true })
+keymap("v", "<C-x>", '"+x', { noremap = true })
+keymap({ "n", "v" }, "<C-p>", '"+p', { noremap = true })
+keymap({ "n", "v" }, "<leader>p", '"+P', { noremap = true })
+
+keymap("n", "<C-d>", "<C-d>zz", { noremap = true })
+keymap("n", "<C-u>", "<C-u>zz", { noremap = true })
+keymap("n", "n", "nzzzv", { noremap = true })
+keymap("n", "N", "Nzzzv", { noremap = true })
+
+keymap("n", "<leader>n", ":NERDTreeFocus<CR>", { noremap = true })
+keymap("n", "<C-n>", ":NERDTree<CR>", { noremap = true })
+keymap("n", "<A-n>", ":NERDTreeToggle<CR>", { noremap = true })
+keymap("n", "<leader>/", ":NERDTreeFind<CR>", { noremap = true })
+
+keymap("n", "<leader>sc", ":set spell!<CR>", { noremap = true, silent = true })
+
+keymap("n", "<A-s>", "<C-W>v", { noremap = true })
+keymap("n", "<A-d>", "<C-W>s", { noremap = true })
+keymap("n", "<A-q>", "ZQ", { noremap = true })
+keymap("n", "<A-z>", "ZZ", { noremap = true })
+keymap("n", "<A-j>", "<C-W>j", { noremap = true })
+keymap("n", "<A-k>", "<C-W>k", { noremap = true })
+keymap("n", "<A-l>", "<C-W>l", { noremap = true })
+keymap("n", "<A-h>", "<C-W>h", { noremap = true })
+keymap("n", "<A-e>", "<C-W>w", { noremap = true })
+keymap("n", "<A-w>", "<C-W>W", { noremap = true })
+
+keymap("n", "<A-,>", "<C-W>5<", { noremap = true })
+keymap("n", "<A-.>", "<C-W>5>", { noremap = true })
+keymap("n", "<A-->", "<C-W>5-", { noremap = true })
+keymap("n", "<A-=>", "<C-W>5+", { noremap = true })
+
+keymap("n", "<A-t>", ":tabnew<CR>", { noremap = true })
+keymap("n", "<A-[>", ":tabprev<CR>", { noremap = true })
+keymap("n", "<A-]>", ":tabnext<CR>", { noremap = true })
+keymap("n", "<A-;>", ":tabmove -<CR>", { noremap = true })
+keymap("n", "<A-'>", ":tabmove +<CR>", { noremap = true })
+keymap("n", "<leader>ft", ":set filetype=", { noremap = true })
+
+-- ui and colors
+vim.cmd("colorscheme tender")
+
+if vim.fn.has("gui_running") == 1 then
+ vim.opt.t_Co = 256
+ vim.opt.guifont = "Roboto Mono 11"
+ vim.opt.guioptions:remove("m")
+ vim.opt.guioptions:remove("T")
+ vim.opt.guioptions:remove("r")
+ vim.opt.guioptions:remove("L")
+ vim.cmd("colorscheme tender")
+end
+
+-- autocmds
+vim.api.nvim_create_autocmd("BufWritePre", {
+ pattern = { "*.py", "*.f90", "*.f95", "*.for" },
+ command = [[%s/\s\+$//e]],
+})
+
+vim.cmd("filetype plugin on")
+vim.cmd("filetype indent on")
+vim.cmd("syntax on")
+vim.cmd("highlight Cursorline cterm=bold ctermbg=black")
+vim.cmd("highlight LineNr guifg=darkgray ctermfg=darkgray")
+vim.cmd("highlight CursorLineNr guifg=cyan ctermfg=cyan")
+
+vim.opt.fillchars = vim.opt.fillchars + {
+ vert = "â–ˆ",
+ fold = "â–ˆ",
+ diff = "â–ˆ",
+ stl = "-",
+ stlnc = "-",
+}
+
+vim.cmd([[
+ hi VertSplit guifg=#151515
+ hi User1 guifg=#999999 guibg=#151515
+ hi User2 guifg=#eea040 guibg=#151515
+ hi User3 guifg=#0072ff guibg=#151515
+ hi User4 guifg=#ffffff guibg=#151515
+ hi User5 guifg=#777777 guibg=#151515
+]])
+
+-- statusline
+vim.o.statusline = table.concat({
+ "%1* %n %*",
+ "%3* %y %*",
+ "%4* %<%f %*",
+ "%2* %m %*",
+ "%1* %= %5l %*",
+ "%2* /%L %*",
+ "%1* %4v %*",
+ "%2* 0x%04B %*",
+ "%5* %{&ff} %*",
+})
+
+-- telescope
+local tele_ok, builtin = pcall(require, "telescope.builtin")
+if tele_ok then
+ keymap("n", "<leader>fg", function()
+ builtin.live_grep({
+ find_command = { "rg", "--ignore", "--hidden", "--files" },
+ prompt_prefix = " search: ",
+ })
+ end, {})
+
+ keymap("n", "<leader>ff", function()
+ builtin.find_files({
+ find_command = { "rg", "--ignore", "--hidden", "--files" },
+ prompt_prefix = " search: ",
+ })
+ end, {})
+
+ keymap("n", "<leader>fb", function()
+ builtin.buffers({
+ prompt_prefix = " search: ",
+ })
+ end, {})
+
+ keymap("n", "<leader>fh", function()
+ builtin.help_tags({
+ prompt_prefix = " search: ",
+ })
+ end, {})
+end
+
+-- treesitter
+local tree_ok, configs = pcall(require, "nvim-treesitter.configs")
+if tree_ok then
+ configs.setup({
+ ensure_installed = {
+ "bash",
+ "lua",
+ "vim",
+ "vimdoc",
+ },
+ sync_install = false,
+ auto_install = true,
+ ignore_install = { "" },
+ highlight = {
+ enable = true,
+ disable = {
+ "php",
+ "markdown",
+ "dockerfile",
+ },
+ additional_vim_regex_highlighting = false,
+ },
+ indent = {
+ enable = true,
+ disable = {
+ "yaml",
+ },
+ },
+ })
+end
+
+-- truezen
+local zen_ok, truezen = pcall(require, "true-zen")
+if zen_ok then
+ keymap("n", "<leader>zn", function()
+ local first = 0
+ local last = vim.api.nvim_buf_line_count(0)
+ truezen.narrow(first, last)
+ end, { noremap = true })
+
+ keymap("v", "<leader>zn", function()
+ local first = vim.fn.line("v")
+ local last = vim.fn.line(".")
+ truezen.narrow(first, last)
+ end, { noremap = true })
+
+ keymap("n", "<leader>zf", truezen.focus, { noremap = true })
+ keymap("n", "<leader>zm", truezen.minimalist, { noremap = true })
+ keymap("n", "<leader>za", truezen.ataraxis, { noremap = true })
+end
+
+-- lsp
+vim.diagnostic.config({
+ update_in_insert = false,
+ severity_sort = true,
+ float = { border = "rounded", source = "if_many" },
+ underline = { severity = { min = vim.diagnostic.severity.WARN } },
+ virtual_text = true,
+})
+
+keymap("n", "[d", vim.diagnostic.goto_prev, { desc = "diagnostic prev" })
+keymap("n", "]d", vim.diagnostic.goto_next, { desc = "diagnostic next" })
+keymap("n", "<leader>e", vim.diagnostic.open_float, { desc = "diagnostic float" })
+keymap("n", "<leader>q", vim.diagnostic.setloclist, { desc = "diagnostic list" })
+
+vim.api.nvim_create_autocmd("LspAttach", {
+ group = vim.api.nvim_create_augroup("user-lsp-attach", { clear = true }),
+ callback = function(event)
+ local map = function(keys, func, desc, mode)
+ mode = mode or "n"
+ vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "lsp: " .. desc })
+ end
+
+ map("grn", vim.lsp.buf.rename, "rename")
+ map("gra", vim.lsp.buf.code_action, "code action", { "n", "x" })
+ map("grD", vim.lsp.buf.declaration, "declaration")
+ map("gri", vim.lsp.buf.implementation, "implementation")
+ map("grr", vim.lsp.buf.references, "references")
+ map("grd", vim.lsp.buf.definition, "definition")
+ map("grt", vim.lsp.buf.type_definition, "type definition")
+ map("K", vim.lsp.buf.hover, "hover")
+
+ local client = vim.lsp.get_client_by_id(event.data.client_id)
+ if client and client:supports_method("textDocument/documentHighlight", event.buf) then
+ local highlight_group = vim.api.nvim_create_augroup("user-lsp-highlight", { clear = false })
+ vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
+ buffer = event.buf,
+ group = highlight_group,
+ callback = vim.lsp.buf.document_highlight,
+ })
+ vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
+ buffer = event.buf,
+ group = highlight_group,
+ callback = vim.lsp.buf.clear_references,
+ })
+ end
+
+ if client and client:supports_method("textDocument/inlayHint", event.buf) then
+ map("<leader>th", function()
+ vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
+ end, "toggle inlay hints")
+ end
+ end,
+})
+
+local ok_fidget, fidget = pcall(require, "fidget")
+if ok_fidget then
+ fidget.setup({})
+end
+
+local ok_mason, mason = pcall(require, "mason")
+local ok_mlsp, mason_lspconfig = pcall(require, "mason-lspconfig")
+local ok_tools, mason_tool_installer = pcall(require, "mason-tool-installer")
+
+local servers = {
+ bashls = {},
+ pylsp = {},
+ lua_ls = {
+ settings = {
+ Lua = {
+ completion = { callSnippet = "Replace" },
+ diagnostics = { globals = { "vim" } },
+ workspace = {
+ checkThirdParty = false,
+ library = vim.api.nvim_get_runtime_file("", true),
+ },
+ telemetry = { enable = false },
+ },
+ },
+ },
+}
+
+if ok_mason then
+ mason.setup()
+end
+
+if ok_tools then
+ mason_tool_installer.setup({ ensure_installed = vim.tbl_keys(servers) })
+end
+
+if ok_mlsp then
+ mason_lspconfig.setup({
+ ensure_installed = vim.tbl_keys(servers),
+ automatic_installation = true,
+ })
+end
+
+for server_name, server_config in pairs(servers) do
+ vim.lsp.config(server_name, server_config)
+ vim.lsp.enable(server_name)
+end
diff --git a/.config/nvim/lua/coc.lua b/.config/nvim/lua/coc.lua
deleted file mode 100644
index 8cc2956..0000000
--- a/.config/nvim/lua/coc.lua
+++ /dev/null
@@ -1,191 +0,0 @@
--- old coc.nvim config (minimal)
--- vim.cmd [[
--- function! CheckBackspace() abort
--- let col = col('.') - 1
--- return !col || getline('.')[col - 1] =~# '\s'
--- endfunction
---
--- inoremap <silent><expr> <TAB>
--- \ coc#pum#visible() ? coc#pum#next(1) :
--- \ CheckBackspace() ? "\<Tab>" :
--- \ coc#refresh()
--- inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
--- ]]
-
--- some servers have issues with backup files, see #649
-vim.opt.backup = false
-vim.opt.writebackup = false
-
--- having longer updatetime (default is 4000 ms = 4s) leads to noticeable
--- delays and poor user experience
-vim.opt.updatetime = 300
-
--- always show the signcolumn, otherwise it would shift the text each time
--- diagnostics appeared/became resolved
-vim.opt.signcolumn = "yes"
-
-local keyset = vim.keymap.set
--- autocomplete
-function _G.check_back_space()
- local col = vim.fn.col('.') - 1
- return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil
-end
-
--- use tab for trigger completion with characters ahead and navigate
--- note: there's always a completion item selected by default, you may want to enable
--- no select by setting `"suggest.noselect": true` in your configuration file
--- note: use command ':verbose imap <tab>' to make sure tab is not mapped by
--- other plugins before putting this into your config
-local opts = {silent = true, noremap = true, expr = true, replace_keycodes = false}
-keyset("i", "<TAB>", 'coc#pum#visible() ? coc#pum#next(1) : v:lua.check_back_space() ? "<TAB>" : coc#refresh()', opts)
-keyset("i", "<S-TAB>", [[coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"]], opts)
-
--- make <cr> to accept selected completion item or notify coc.nvim to format
--- <c-g>u breaks current undo, please make your own choice
-keyset("i", "<cr>", [[coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"]], opts)
-
--- use <c-j> to trigger snippets
-keyset("i", "<c-j>", "<Plug>(coc-snippets-expand-jump)")
--- use <c-c> to trigger completion
-keyset("i", "<c-c>", "coc#refresh()", {silent = true, expr = true})
-
--- use `[g` and `]g` to navigate diagnostics
--- use `:cocdiagnostics` to get all diagnostics of current buffer in location list
-keyset("n", "[g", "<Plug>(coc-diagnostic-prev)", {silent = true})
-keyset("n", "]g", "<Plug>(coc-diagnostic-next)", {silent = true})
-
--- goto code navigation
-keyset("n", "gd", "<Plug>(coc-definition)", {silent = true})
-keyset("n", "gy", "<Plug>(coc-type-definition)", {silent = true})
-keyset("n", "gi", "<Plug>(coc-implementation)", {silent = true})
-keyset("n", "gr", "<Plug>(coc-references)", {silent = true})
-
--- use k to show documentation in preview window
-function _G.show_docs()
- local cw = vim.fn.expand('<cword>')
- if vim.fn.index({'vim', 'help'}, vim.bo.filetype) >= 0 then
- vim.api.nvim_command('h ' .. cw)
- elseif vim.api.nvim_eval('coc#rpc#ready()') then
- vim.fn.CocActionAsync('doHover')
- else
- vim.api.nvim_command('!' .. vim.o.keywordprg .. ' ' .. cw)
- end
-end
-keyset("n", "K", '<CMD>lua _G.show_docs()<CR>', {silent = true})
-
--- highlight the symbol and its references on a cursorhold event(cursor is idle)
-vim.api.nvim_create_augroup("CocGroup", {})
-vim.api.nvim_create_autocmd("CursorHold", {
- group = "CocGroup",
- command = "silent call CocActionAsync('highlight')",
- desc = "Highlight symbol under cursor on CursorHold"
-})
-
--- symbol renaming
-keyset("n", "<leader>rn", "<Plug>(coc-rename)", {silent = true})
-
--- formatting selected code
-keyset("x", "<leader>F", "<Plug>(coc-format-selected)", {silent = true})
-keyset("n", "<leader>F", "<Plug>(coc-format-selected)", {silent = true})
-
--- setup formatexpr specified filetype(s)
-vim.api.nvim_create_autocmd("FileType", {
- group = "CocGroup",
- pattern = "typescript,json",
- command = "setl formatexpr=CocAction('formatSelected')",
- desc = "Setup formatexpr specified filetype(s)."
-})
-
--- update signature help on jump placeholder
-vim.api.nvim_create_autocmd("User", {
- group = "CocGroup",
- pattern = "CocJumpPlaceholder",
- command = "call CocActionAsync('showSignatureHelp')",
- desc = "Update signature help on jump placeholder"
-})
-
--- apply codeaction to the selected region
--- example: `<leader>aap` for current paragraph
-local opts = {silent = true, nowait = true}
-keyset("x", "<leader>a", "<Plug>(coc-codeaction-selected)", opts)
-keyset("n", "<leader>a", "<Plug>(coc-codeaction-selected)", opts)
-
--- remap keys for apply code actions at the cursor position.
-keyset("n", "<leader>ac", "<Plug>(coc-codeaction-cursor)", opts)
--- remap keys for apply source code actions for current file.
-keyset("n", "<leader>as", "<Plug>(coc-codeaction-source)", opts)
--- apply the most preferred quickfix action on the current line.
-keyset("n", "<leader>qf", "<Plug>(coc-fix-current)", opts)
-
--- remap keys for apply refactor code actions.
-keyset("n", "<leader>re", "<Plug>(coc-codeaction-refactor)", { silent = true })
-keyset("x", "<leader>r", "<Plug>(coc-codeaction-refactor-selected)", { silent = true })
-keyset("n", "<leader>r", "<Plug>(coc-codeaction-refactor-selected)", { silent = true })
-
--- run the code lens actions on the current line
-keyset("n", "<leader>cl", "<Plug>(coc-codelens-action)", opts)
-
-
--- map function and class text objects
--- note: requires 'textdocument.documentsymbol' support from the language server
-keyset("x", "if", "<Plug>(coc-funcobj-i)", opts)
-keyset("o", "if", "<Plug>(coc-funcobj-i)", opts)
-keyset("x", "af", "<Plug>(coc-funcobj-a)", opts)
-keyset("o", "af", "<Plug>(coc-funcobj-a)", opts)
-keyset("x", "ic", "<Plug>(coc-classobj-i)", opts)
-keyset("o", "ic", "<Plug>(coc-classobj-i)", opts)
-keyset("x", "ac", "<Plug>(coc-classobj-a)", opts)
-keyset("o", "ac", "<Plug>(coc-classobj-a)", opts)
-
-
--- remap <c-f> and <c-b> to scroll float windows/popups
----@diagnostic disable-next-line: redefined-local
-local opts = {silent = true, nowait = true, expr = true}
-keyset("n", "<C-f>", 'coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"', opts)
-keyset("n", "<C-b>", 'coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"', opts)
-keyset("i", "<C-f>",
- 'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(1)<cr>" : "<Right>"', opts)
-keyset("i", "<C-b>",
- 'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(0)<cr>" : "<Left>"', opts)
-keyset("v", "<C-f>", 'coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"', opts)
-keyset("v", "<C-b>", 'coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"', opts)
-
--- use ctrl-s for selections ranges
--- requires 'textdocument/selectionrange' support of language server
-keyset("n", "<C-s>", "<Plug>(coc-range-select)", {silent = true})
-keyset("x", "<C-s>", "<Plug>(coc-range-select)", {silent = true})
-
--- add `:format` command to format current buffer
-vim.api.nvim_create_user_command("Format", "call CocAction('format')", {})
-
--- " add `:fold` command to fold current buffer
-vim.api.nvim_create_user_command("Fold", "call CocAction('fold', <f-args>)", {nargs = '?'})
-
--- add `:or` command for organize imports of the current buffer
-vim.api.nvim_create_user_command("OR", "call CocActionAsync('runCommand', 'editor.action.organizeImport')", {})
-
--- mappings for coclist
--- code actions and coc stuff
----@diagnostic disable-next-line: redefined-local
-local opts = {silent = true, nowait = true}
--- show all diagnostics
-keyset("n", "<space>a", ":<C-u>CocList diagnostics<cr>", opts)
--- manage extensions
-keyset("n", "<space>e", ":<C-u>CocList extensions<cr>", opts)
--- show commands
-keyset("n", "<space>c", ":<C-u>CocList commands<cr>", opts)
--- find symbol of current document
-keyset("n", "<space>o", ":<C-u>CocList outline<cr>", opts)
--- search workspace symbols
-keyset("n", "<space>s", ":<C-u>CocList -I symbols<cr>", opts)
--- do default action for next item
-keyset("n", "<space>j", ":<C-u>CocNext<cr>", opts)
--- do default action for previous item
-keyset("n", "<space>k", ":<C-u>CocPrev<cr>", opts)
--- resume latest coc list
-keyset("n", "<space>p", ":<C-u>CocListResume<cr>", opts)
-
--- add (neo)vim's native statusline support
--- note: please see `:h coc-status` for integrations with external plugins that
--- provide custom statusline: lightline.vim, vim-airline
--- vim.opt.statusline:prepend("%{coc#status()}%{get(b:,'coc_current_function','')}")
diff --git a/.config/nvim/lua/keys.lua b/.config/nvim/lua/keys.lua
deleted file mode 100644
index 22f1d81..0000000
--- a/.config/nvim/lua/keys.lua
+++ /dev/null
@@ -1,54 +0,0 @@
--- legacy keybinds for x11 clipboard
-vim.cmd [[
- vnoremap <C-c> "+y
- vmap <C-x> "+x
- map <C-p> "+p
- map <Leader>p "+P
-]]
-
--- vertical motion remappings
-vim.api.nvim_set_keymap("n", "<C-d>", "<C-d>zz", { noremap = true })
-vim.api.nvim_set_keymap("n", "<C-u>", "<C-u>zz", { noremap = true })
-vim.api.nvim_set_keymap("n", "n", "nzzzv", { noremap = true })
-vim.api.nvim_set_keymap("n", "N", "Nzzzv", { noremap = true })
-
--- nerdtree keybinds
-vim.api.nvim_set_keymap("n", "<leader>n", ":NERDTreeFocus<CR>", { noremap = true })
-vim.api.nvim_set_keymap("n", "<C-n>", ":NERDTree<CR>", { noremap = true })
-vim.api.nvim_set_keymap("n", "<A-n>", ":NERDTreeToggle<CR>", { noremap = true })
-vim.api.nvim_set_keymap("n", "<leader>/", ":NERDTreeFind<CR>", { noremap = true })
-
--- spell check keybinds
-vim.api.nvim_set_keymap("n", "<leader>sc", ":set spell!<CR>", { silent = true })
-
--- splits and vsplits creation rebinds
-vim.api.nvim_set_keymap('n', '<A-s>', '<C-W>v', { noremap = true })
-vim.api.nvim_set_keymap('n', '<A-d>', '<C-W>s', { noremap = true })
-
--- splits quit and save&quit
-vim.api.nvim_set_keymap('n', '<A-q>', 'ZQ', { noremap = true })
-vim.api.nvim_set_keymap('n', '<A-z>', 'ZZ', { noremap = true })
-
--- splits and vsplits movement rebinds
-vim.api.nvim_set_keymap('n', '<A-j>', '<C-W>j', { noremap = true })
-vim.api.nvim_set_keymap('n', '<A-k>', '<C-W>k', { noremap = true })
-vim.api.nvim_set_keymap('n', '<A-l>', '<C-W>l', { noremap = true })
-vim.api.nvim_set_keymap('n', '<A-h>', '<C-W>h', { noremap = true })
-vim.api.nvim_set_keymap('n', '<A-e>', '<C-W>w', { noremap = true })
-vim.api.nvim_set_keymap('n', '<A-w>', '<C-W>W', { noremap = true })
-
--- splits and vsplits resize rebinds
-vim.api.nvim_set_keymap('n', '<A-,>', '<C-W>5<', { noremap = true })
-vim.api.nvim_set_keymap('n', '<A-.>', '<C-W>5>', { noremap = true })
-vim.api.nvim_set_keymap('n', '<A-->', '<C-W>5-', { noremap = true })
-vim.api.nvim_set_keymap('n', '<A-=>', '<C-W>5+', { noremap = true })
-
--- tab rebinds
-vim.api.nvim_set_keymap('n', '<A-t>', ':tabnew<CR>', { noremap = true })
-vim.api.nvim_set_keymap('n', '<A-[>', ':tabprev<CR>', { noremap = true })
-vim.api.nvim_set_keymap('n', '<A-]>', ':tabnext<CR>', { noremap = true })
-vim.api.nvim_set_keymap('n', '<A-;>', ':tabmove -<CR>', { noremap = true })
-vim.api.nvim_set_keymap('n', '<A-\'>', ':tabmove +<CR>', { noremap = true })
-
--- set file type keybind
-vim.api.nvim_set_keymap('n', '<leader>ft', ':set filetype=', { noremap = true })
diff --git a/.config/nvim/lua/look.lua b/.config/nvim/lua/look.lua
deleted file mode 100644
index ccfd8b0..0000000
--- a/.config/nvim/lua/look.lua
+++ /dev/null
@@ -1,69 +0,0 @@
--- colorscheme declaration
-vim.cmd("colorscheme tender")
-
--- coc.nvim colors
-vim.cmd("highlight CocFloating ctermbg=0")
-vim.cmd("highlight CocErrorFloat ctermfg=15")
-
--- gui appearance declarations
-if vim.fn.has('gui_running') == 1 then
- vim.opt.t_Co = 256
- vim.opt.guifont = "Roboto Mono 11"
- vim.opt.guioptions:remove("m")
- vim.opt.guioptions:remove("T")
- vim.opt.guioptions:remove("r")
- vim.opt.guioptions:remove("L")
- vim.cmd("colorscheme tender")
-end
-
--- remove trailing whitespace from python and fortran files
-vim.api.nvim_exec([[
- autocmd BufWritePre *.py :%s/\s\+$//e
- autocmd BufWritePre *.f90 :%s/\s\+$//e
- autocmd BufWritePre *.f95 :%s/\s\+$//e
- autocmd BufWritePre *.for :%s/\s\+$//e
-]], false)
-
--- other appearance settings that I don't know how to set in lua
-vim.cmd("filetype plugin on")
-vim.cmd("syntax on")
-vim.cmd("highlight Cursorline cterm=bold ctermbg=black")
-vim.cmd("filetype indent on")
--- set the text color of the line numbers
-vim.cmd('highlight LineNr guifg=darkgray ctermfg=darkgray')
--- set the text color for the current line number
-vim.cmd('highlight CursorLineNr guifg=cyan ctermfg=cyan')
-
--- customize split dividers
-vim.opt.fillchars = vim.opt.fillchars + {
- vert = "â–ˆ",
- fold = "â–ˆ",
- diff = "â–ˆ",
- stl = "-",
- stlnc = "-",
- stl = "-"
-}
-
--- set statusline colors
-vim.cmd([[
- hi VertSplit guifg=#151515
- hi User1 guifg=#999999 guibg=#151515
- hi User2 guifg=#eea040 guibg=#151515
- hi User3 guifg=#0072ff guibg=#151515
- hi User4 guifg=#ffffff guibg=#151515
- hi User5 guifg=#777777 guibg=#151515
-]])
-
--- set statusline
-vim.o.statusline = table.concat({
- "%1* %n %*", -- buffer number
- "%3* %y %*", -- file type
- -- "%4* %<%F %*", -- full path
- "%4* %<%f %*", -- file name
- "%2* %m %*", -- modified flag
- "%1* %= %5l %*", -- current line
- "%2* /%L %*", -- total lines
- "%1* %4v %*", -- virtual column number
- "%2* 0x%04B %*", -- character under cursor
- "%5* %{&ff} %*", -- file format
-})
diff --git a/.config/nvim/lua/opts.lua b/.config/nvim/lua/opts.lua
deleted file mode 100644
index 3f7dc11..0000000
--- a/.config/nvim/lua/opts.lua
+++ /dev/null
@@ -1,47 +0,0 @@
-local opts = {
- -- clipboard = "unnamedplus",
- -- textwidth = 80,
- autochdir = true,
- autoindent = true,
- cursorline = true,
- expandtab = true,
- hlsearch = true,
- ignorecase = true,
- linebreak = true,
- listchars = { tab = ">-", trail = "~", extends = ">", precedes = "<", space = "." },
- mouse = "a",
- number = true,
- relativenumber = true,
- shiftwidth = 4,
- showmatch = true,
- smartcase = true,
- softtabstop = 4,
- splitbelow = true,
- splitright = true,
- tabstop = 4,
- termguicolors = true,
- ttimeout = true,
- ttimeoutlen = 1,
- ttyfast = true,
- undofile = true,
-}
-
--- use a line cursor within insert mode and a block cursor everywhere else.
--- reference chart of values:
--- ps = 0 -> blinking block.
--- ps = 1 -> blinking block (default).
--- ps = 2 -> steady block.
--- ps = 3 -> blinking underline.
--- ps = 4 -> steady underline.
--- ps = 5 -> blinking bar (xterm).
--- ps = 6 -> steady bar (xterm).
-vim.g.t_SI = "\27[6 q"
-vim.g.t_EI = "\27[2 q"
-
-if vim.env.TERM == "alacritty" then
- vim.opt.ttymouse = "sgr"
-end
-
-for k, v in pairs(opts) do
- vim.opt[k] = v
-end
diff --git a/.config/nvim/lua/plug.lua b/.config/nvim/lua/plug.lua
deleted file mode 100644
index a77459a..0000000
--- a/.config/nvim/lua/plug.lua
+++ /dev/null
@@ -1,20 +0,0 @@
--- legacy plugin manager config (vim-plug)
-vim.cmd [[
- call plug#begin()
- Plug 'https://github.com/preservim/nerdtree', { 'on': 'NERDTreeToggle' }
- Plug 'tmsvg/pear-tree'
- Plug 'https://github.com/adelarsq/vim-matchit'
- Plug 'neoclide/coc.nvim', {'branch': 'release'}
- Plug 'tpope/vim-surround'
- Plug 'sbdchd/neoformat'
- Plug 'ThePrimeagen/vim-be-good'
- Plug 'junegunn/fzf'
- Plug 'nvim-lua/plenary.nvim'
- Plug 'nvim-telescope/telescope.nvim', { 'branch': '0.1.x' }
- Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
- Plug 'Pocco81/true-zen.nvim'
-
- " Plug 'LunarWatcher/auto-pairs'
- call plug#end()
-]]
-
diff --git a/.config/nvim/lua/tele.lua b/.config/nvim/lua/tele.lua
deleted file mode 100644
index f264799..0000000
--- a/.config/nvim/lua/tele.lua
+++ /dev/null
@@ -1,29 +0,0 @@
-local builtin = require('telescope.builtin')
-
-vim.keymap.set('n', '<leader>fg', function()
- builtin.live_grep({
- find_command = {'rg', '--ignore', '--hidden', '--files'},
- prompt_prefix = ' search: '
- })
-end, {})
-
-vim.keymap.set('n', '<leader>ff', function()
- builtin.find_files({
- find_command = {'rg', '--ignore', '--hidden', '--files'},
- prompt_prefix = ' search: '
- })
-end, {})
-
-vim.keymap.set('n', '<leader>fb', function()
- builtin.buffers({
- find_command = {'rg', '--ignore', '--hidden', '--files'},
- prompt_prefix = ' search: '
- })
-end, {})
-
-vim.keymap.set('n', '<leader>fh', function()
- builtin.help_tags({
- find_command = {'rg', '--ignore', '--hidden', '--files'},
- prompt_prefix = ' search: '
- })
-end, {})
diff --git a/.config/nvim/lua/tree.lua b/.config/nvim/lua/tree.lua
deleted file mode 100644
index 24d5dc3..0000000
--- a/.config/nvim/lua/tree.lua
+++ /dev/null
@@ -1,32 +0,0 @@
-local status_ok, configs = pcall(require, "nvim-treesitter.configs")
-if not status_ok then
- return
-end
-
-configs.setup {
- ensure_installed = {
- "bash",
- "lua",
- "vim",
- "vimdoc",
- },
-
- sync_install = false,
- auto_install = true,
- ignore_install = { "" },
- highlight = {
- enable = true,
- disable = {
- "php",
- "markdown",
- "dockerfile"
- },
- additional_vim_regex_highlighting = false,
- },
- indent = {
- enable = true,
- disable = {
- "yaml",
- },
- },
-}
diff --git a/.config/nvim/lua/zen.lua b/.config/nvim/lua/zen.lua
deleted file mode 100644
index 1f607b4..0000000
--- a/.config/nvim/lua/zen.lua
+++ /dev/null
@@ -1,16 +0,0 @@
-local truezen = require('true-zen')
-local keymap = vim.keymap
-
-keymap.set('n', '<leader>zn', function()
- local first = 0
- local last = vim.api.nvim_buf_line_count(0)
- truezen.narrow(first, last)
-end, { noremap = true })
-keymap.set('v', '<leader>zn', function()
- local first = vim.fn.line('v')
- local last = vim.fn.line('.')
- truezen.narrow(first, last)
-end, { noremap = true })
-keymap.set('n', '<leader>zf', truezen.focus, { noremap = true })
-keymap.set('n', '<leader>zm', truezen.minimalist, { noremap = true })
-keymap.set('n', '<leader>za', truezen.ataraxis, { noremap = true })