diff options
Diffstat (limited to '.config')
| -rw-r--r-- | .config/nvim/README.md | 27 | ||||
| -rw-r--r-- | .config/nvim/init.lua | 1 | ||||
| -rw-r--r-- | .config/nvim/lua/plugins/harpoon.lua | 11 | ||||
| -rw-r--r-- | .config/nvim/lua/user/keys.lua | 14 | ||||
| -rw-r--r-- | .config/nvim/lua/user/mods.lua | 2 | ||||
| -rw-r--r-- | .config/nvim/lua/user/opts.lua | 15 | ||||
| -rw-r--r-- | .config/nvim/lua/user/pack.lua | 1 |
7 files changed, 62 insertions, 9 deletions
diff --git a/.config/nvim/README.md b/.config/nvim/README.md index 2659734..78fee36 100644 --- a/.config/nvim/README.md +++ b/.config/nvim/README.md @@ -1,7 +1,28 @@ ## Neovim #### TODOS: -- [ ] Markdown filetype plugin or autocommand to add two spaces each line. -- [ ] Markdown filetype plugin or autocommand to make backtick auto-correct properly. +- [ ] Markdown filetype plugin or autocommand to add two spaces each line +- [ ] Markdown filetype plugin or autocommand to make backtick auto-correct properly +- [ ] Indent by filetype/fix global indent (2) - [ ] Check history or telescope history of last files edited or opened. - +- [ ] * Windows native support configuration +- [ ] * Python debugger +- [ ] README file heirachcy +- [ ] Markdown snippet for code blocks with list, ie.- `` and - ``` ``` +- [ ] Snippet for filler text with variations, ie. common sentences: The quick brown fox... and more and placeholder words +- [ ] Configure snippets.lua +- [ ] Documentation shortcuts for different languages quote in quote "locally" (preffered) or opening web browser +- [ ] Dictionary, an actual dictionary +- [ ] Null-ls/lsp keymap to check current buffer servers must check both same time +> NOTE: Different servers must be configured only to one or another, research null-ls being archived +- [ ] Don't highlight whitespaces in lazygit (maybe exclusively markdown) +- [ ] Configure prettier/prettierd servers to join a lot of different files (null-ls) +- [ ] Nvim-tree preview window similar to telescope +- [ ] Nvim-tree behaviour when delete current buffer +> NOTE: One idea is to create an autocmd to make a blank window (hidden) as a secondary window but when creating a opening a new file it does not ask which split to open in +- [ ] Nvim-tree conditionally when open going in the opposite direction will go back to nvim-tree ie. going right then goes to nvim-tree but is conditionally because of tmux etc... +- [x] Substitute keybinding +- [ ] Snippet/filetype plugin for markdown tick boxes +- [ ] Delete lua/user/func.lua +- [ ] Clean entire config by prioritizing single quotation marks over double +- [ ] <placeholder> diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index b3f7a93..08f5cf7 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -78,6 +78,7 @@ local modules = { --"plugins.prettier", --"plugins.git", "plugins.lsp", + --"plugins.fugitive", "plugins.gitsigns", "plugins.neoscroll", "plugins.statuscol", diff --git a/.config/nvim/lua/plugins/harpoon.lua b/.config/nvim/lua/plugins/harpoon.lua index eac4f35..784ee0b 100644 --- a/.config/nvim/lua/plugins/harpoon.lua +++ b/.config/nvim/lua/plugins/harpoon.lua @@ -21,3 +21,14 @@ vim.api.nvim_set_keymap("n", "<leader>mh", ":lua require('harpoon.ui').nav_file( vim.api.nvim_set_keymap("n", "<leader>mj", ":lua require('harpoon.ui').nav_file(2)<CR>", {}) vim.api.nvim_set_keymap("n", "<leader>mk", ":lua require('harpoon.ui').nav_file(3)<CR>", {}) vim.api.nvim_set_keymap("n", "<leader>ml", ":lua require('harpoon.ui').nav_file(4)<CR>", {}) + +--local mark = require("harpoon.mark") +--local ui = require("harpoon.ui") +-- +--vim.keymap.set("n", "<leader>a", mark.add_file) +--vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu) +-- +--vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end) +--vim.keymap.set("n", "<C-t>", function() ui.nav_file(2) end) +--vim.keymap.set("n", "<C-n>", function() ui.nav_file(3) end) +--vim.keymap.set("n", "<C-s>", function() ui.nav_file(4) end) diff --git a/.config/nvim/lua/user/keys.lua b/.config/nvim/lua/user/keys.lua index a20b0ea..2ba14dd 100644 --- a/.config/nvim/lua/user/keys.lua +++ b/.config/nvim/lua/user/keys.lua @@ -170,7 +170,8 @@ map("i", "<C-l>", "<Del>") map("n", "<leader><C-l>", "<Cmd>!clear<CR>") -- Change file to an executable -map("n", "<Leader>x", ":lua require('user.mods').Toggle_executable()<CR> | :echom ('Toggle executable')<CR> | :sl! | echo ('')<CR>") +map("n", "<Leader>x", + ":lua require('user.mods').Toggle_executable()<CR> | :echom ('Toggle executable')<CR> | :sl! | echo ('')<CR>") --map("n", "<leader>x", ":!chmod +x %<CR>") -- Paste without replace clipboard @@ -197,6 +198,10 @@ else map[''].gx = { '<Cmd>lua print("Error: gx is not supported on this OS!")<CR>' } end +-- Substitute globally and locally in the selected region. +map("n", "ss", ":%s//g<Left><Left>") +map("v", "ss", ":s//g<Left><Left>") + -- Toggle completion map("n", "<Leader>tc", ":lua require('user.mods').toggle_completion()<CR>") @@ -263,6 +268,7 @@ map('n', '<C-j>', '<CMD>NavigatorDown<CR>') map({ "n", "t" }, "<leader>gg", "<cmd>lua Lazygit_toggle()<CR>") -- Fugitive git bindings +map("n", "<leader>gs", vim.cmd.Git) map("n", "<leader>ga", ":Git add %:p<CR><CR>") --map("n", "<leader>gs", ":Gstatus<CR>") map("n", "<leader>gc", ":Gcommit -v -q<CR>") @@ -312,7 +318,8 @@ map("n", "<leader>fw", [[<Cmd>lua require'plugins.telescope'.find_projects()<CR> map("n", "<leader>fm", "<cmd>lua require('telescope').extensions.media_files.media_files({})<cr>") -- find media files map("n", "<leader>fi", "<cmd>lua require('telescope').extensions.notify.notify({})<cr>") -- find notifications --map("n", "<leader>f/", "<cmd>lua require('plugins.telescope').curbuf()<cr>") -- find files with hidden option -map("n", "<leader>fF", ":cd %:p:h<CR>:pwd<CR><cmd>lua require('user.mods').findFilesInCwd()<CR>", { noremap = true, silent = true, desc = "Find files in cwd" }) +map("n", "<leader>fF", ":cd %:p:h<CR>:pwd<CR><cmd>lua require('user.mods').findFilesInCwd()<CR>", + { noremap = true, silent = true, desc = "Find files in cwd" }) -- FZF map("n", "<leader>fz", "<cmd>lua require('fzf-lua').files()<CR>") @@ -320,6 +327,9 @@ map("n", "<leader>fz", "<cmd>lua require('fzf-lua').files()<CR>") -- Nvim-tree map("n", "<leader>f", ":NvimTreeToggle<CR>", {}) +-- Undotree +map('n', '<leader>u', vim.cmd.UndotreeToggle) + -- Markdown-preview map("n", "<leader>md", "<Plug>MarkdownPreviewToggle") map("n", "<leader>mg", "<CMD>Glow<CR>") diff --git a/.config/nvim/lua/user/mods.lua b/.config/nvim/lua/user/mods.lua index f00621d..2f14acd 100644 --- a/.config/nvim/lua/user/mods.lua +++ b/.config/nvim/lua/user/mods.lua @@ -441,7 +441,7 @@ function M.Update_neovim() end -- Bind a keymap to the update_neovim function (optional) -vim.api.nvim_set_keymap('n', '<leader>u', '<cmd> lua require("user.mods").Update_neovim()<CR>', +vim.api.nvim_set_keymap('n', '<leader>U', '<cmd> lua require("user.mods").Update_neovim()<CR>', { noremap = true, silent = true }) diff --git a/.config/nvim/lua/user/opts.lua b/.config/nvim/lua/user/opts.lua index 6375350..bb7f36c 100644 --- a/.config/nvim/lua/user/opts.lua +++ b/.config/nvim/lua/user/opts.lua @@ -47,8 +47,10 @@ vim.o.autochdir = true -- Colors vim.opt.termguicolors = true +-- Clipboard +vim.opt.clipboard:append({ "unnamedplus" }) -- Install xclip or this will slowdown startup + -- Behaviour -vim.opt.clipboard:append({ "unnamedplus" }) -- Install xclip or this will slowdown startup vim.opt.backspace = { "start", "eol", "indent" } -- Make backspace work as you would expect. vim.opt.hidden = true -- Switch between buffers without having to save first. vim.opt.splitbelow = true -- make split put the new buffer below the current buffer @@ -123,11 +125,13 @@ vim.opt.report = 0 -- Always report changed lines. -- Backup/undo/swap local prefix = vim.env.XDG_CONFIG_HOME or vim.fn.expand("~/.config") +--vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" vim.opt.undodir = { prefix .. "/nvim/tmp/.undo//" } vim.opt.backupdir = { prefix .. "/nvim/tmp/.backup//" } vim.opt.directory = { prefix .. "/nvim/tmp/.swp//" } vim.opt.backup = false -- -vim.opt.undofile = false -- +--vim.opt.undofile = false -- +vim.opt.undofile = true -- vim.opt.swapfile = true -- -- Add timestamp as extension for backup files vim.api.nvim_create_autocmd('BufWritePre', { @@ -141,6 +145,7 @@ vim.api.nvim_create_autocmd('BufWritePre', { -- Format --vim.opt.textwidth = 80 -- +vim.opt.isfname:append("@-@") vim.cmd([[let &t_Cs = "\e[4:3m"]]) -- Undercurl vim.cmd([[let &t_Ce = "\e[4:0m"]]) -- vim.opt.path:append({ "**" }) -- Finding files - Search down into subfolder @@ -243,7 +248,11 @@ vim.opt.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpo --vim.opt.sessionoptions = "buffers,curdir,folds,help,tabpages,winsize,winpos,terminal" --vim.opt.sessionoptions:remove({ "blank", "buffers", "globals" }) -vim.opt.clipboard:append({ "unnamedplus" }) -- Install xclip or this will slowdown startup +-- Netrw file tree +vim.g.netrw_browse_split = 0 +vim.g.netrw_banner = 0 +vim.g.netrw_winsize = 25 + -- Cursorline vim.cmd([[ " Only show cursorline in the current window and in normal mode augroup cline diff --git a/.config/nvim/lua/user/pack.lua b/.config/nvim/lua/user/pack.lua index d2fad3c..177f8d8 100644 --- a/.config/nvim/lua/user/pack.lua +++ b/.config/nvim/lua/user/pack.lua @@ -170,6 +170,7 @@ return packer.startup(function(use) use("tpope/vim-unimpaired") -- --use("vimpostor/vim-tpipeline") -- --use("nathom/filetype.nvim") -- + use("mbbill/undotree") use({ "myusuf3/numbers.vim", -- vim.cmd("let g:numbers_exclude = ['dashboard']") }) |
