From 0d3a244ff2d3f10d3d3946fbff55b11451cb53e5 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sun, 16 Jul 2023 02:34:48 +0200 Subject: Add Substitute keybindings --- lua/user/keys.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/user/keys.lua b/lua/user/keys.lua index a20b0ea..d16af95 100644 --- a/lua/user/keys.lua +++ b/lua/user/keys.lua @@ -197,6 +197,10 @@ else map[''].gx = { 'lua print("Error: gx is not supported on this OS!")' } end +-- Substitute globally and locally in the selected region. +map("n", "ss", ":%s//g") +map("v", "ss", ":s//g") + -- Toggle completion map("n", "tc", ":lua require('user.mods').toggle_completion()") -- cgit v1.2.3 From 6d91b682a774a66c6647893571488d423aea6901 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sun, 16 Jul 2023 03:06:18 +0200 Subject: Set undofile to true --- lua/user/opts.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/user/opts.lua b/lua/user/opts.lua index 6375350..9f9293a 100644 --- a/lua/user/opts.lua +++ b/lua/user/opts.lua @@ -123,11 +123,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 +143,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 -- cgit v1.2.3 From 58bf5b89525ed7aa38709437e139173758484f52 Mon Sep 17 00:00:00 2001 From: srdusr Date: Sun, 16 Jul 2023 03:19:05 +0200 Subject: Add undotree keybinding --- lua/user/keys.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/user/keys.lua b/lua/user/keys.lua index d16af95..2ba14dd 100644 --- a/lua/user/keys.lua +++ b/lua/user/keys.lua @@ -170,7 +170,8 @@ map("i", "", "") map("n", "", "!clear") -- Change file to an executable -map("n", "x", ":lua require('user.mods').Toggle_executable() | :echom ('Toggle executable') | :sl! | echo ('')") +map("n", "x", + ":lua require('user.mods').Toggle_executable() | :echom ('Toggle executable') | :sl! | echo ('')") --map("n", "x", ":!chmod +x %") -- Paste without replace clipboard @@ -267,6 +268,7 @@ map('n', '', 'NavigatorDown') map({ "n", "t" }, "gg", "lua Lazygit_toggle()") -- Fugitive git bindings +map("n", "gs", vim.cmd.Git) map("n", "ga", ":Git add %:p") --map("n", "gs", ":Gstatus") map("n", "gc", ":Gcommit -v -q") @@ -316,7 +318,8 @@ map("n", "fw", [[lua require'plugins.telescope'.find_projects() map("n", "fm", "lua require('telescope').extensions.media_files.media_files({})") -- find media files map("n", "fi", "lua require('telescope').extensions.notify.notify({})") -- find notifications --map("n", "f/", "lua require('plugins.telescope').curbuf()") -- find files with hidden option -map("n", "fF", ":cd %:p:h:pwdlua require('user.mods').findFilesInCwd()", { noremap = true, silent = true, desc = "Find files in cwd" }) +map("n", "fF", ":cd %:p:h:pwdlua require('user.mods').findFilesInCwd()", + { noremap = true, silent = true, desc = "Find files in cwd" }) -- FZF map("n", "fz", "lua require('fzf-lua').files()") @@ -324,6 +327,9 @@ map("n", "fz", "lua require('fzf-lua').files()") -- Nvim-tree map("n", "f", ":NvimTreeToggle", {}) +-- Undotree +map('n', 'u', vim.cmd.UndotreeToggle) + -- Markdown-preview map("n", "md", "MarkdownPreviewToggle") map("n", "mg", "Glow") -- cgit v1.2.3 From ebbf5e53e79e7fede71de5dbbed1704d4cc5cb26 Mon Sep 17 00:00:00 2001 From: srdusr Date: Mon, 17 Jul 2023 21:30:45 +0200 Subject: Add commented out possible configuration ideas --- lua/plugins/harpoon.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua index eac4f35..784ee0b 100644 --- a/lua/plugins/harpoon.lua +++ b/lua/plugins/harpoon.lua @@ -21,3 +21,14 @@ vim.api.nvim_set_keymap("n", "mh", ":lua require('harpoon.ui').nav_file( vim.api.nvim_set_keymap("n", "mj", ":lua require('harpoon.ui').nav_file(2)", {}) vim.api.nvim_set_keymap("n", "mk", ":lua require('harpoon.ui').nav_file(3)", {}) vim.api.nvim_set_keymap("n", "ml", ":lua require('harpoon.ui').nav_file(4)", {}) + +--local mark = require("harpoon.mark") +--local ui = require("harpoon.ui") +-- +--vim.keymap.set("n", "a", mark.add_file) +--vim.keymap.set("n", "", ui.toggle_quick_menu) +-- +--vim.keymap.set("n", "", function() ui.nav_file(1) end) +--vim.keymap.set("n", "", function() ui.nav_file(2) end) +--vim.keymap.set("n", "", function() ui.nav_file(3) end) +--vim.keymap.set("n", "", function() ui.nav_file(4) end) -- cgit v1.2.3 From 65a293b86b9fc20b342573a3e0dee1d20c97d610 Mon Sep 17 00:00:00 2001 From: srdusr Date: Mon, 17 Jul 2023 21:31:14 +0200 Subject: Changed Update_neovim() keybinding to leader+U --- lua/user/mods.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/user/mods.lua b/lua/user/mods.lua index f00621d..2f14acd 100644 --- a/lua/user/mods.lua +++ b/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', 'u', ' lua require("user.mods").Update_neovim()', +vim.api.nvim_set_keymap('n', 'U', ' lua require("user.mods").Update_neovim()', { noremap = true, silent = true }) -- cgit v1.2.3 From 667758965e4a1e1a04ed6a7ebaf6aefc22be96f7 Mon Sep 17 00:00:00 2001 From: srdusr Date: Mon, 17 Jul 2023 21:31:52 +0200 Subject: Add Netrw configuration --- lua/user/opts.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/user/opts.lua b/lua/user/opts.lua index 9f9293a..bb7f36c 100644 --- a/lua/user/opts.lua +++ b/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 @@ -246,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 -- cgit v1.2.3 From 116125030260b6b4b491fc72b719748fe61d9759 Mon Sep 17 00:00:00 2001 From: srdusr Date: Mon, 17 Jul 2023 21:32:12 +0200 Subject: Installed mbbill/undotree --- lua/user/pack.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/user/pack.lua b/lua/user/pack.lua index d2fad3c..177f8d8 100644 --- a/lua/user/pack.lua +++ b/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']") }) -- cgit v1.2.3 From 904ef61e434d3e79eef0f88c899d0d706b59e3cd Mon Sep 17 00:00:00 2001 From: srdusr Date: Mon, 17 Jul 2023 21:32:25 +0200 Subject: Add a bunch of todos --- README.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2659734..78fee36 100644 --- a/README.md +++ b/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 +- [ ] -- cgit v1.2.3 From 01e02751d178a92284b1dcfdcd9a4aa6220ec364 Mon Sep 17 00:00:00 2001 From: srdusr Date: Mon, 17 Jul 2023 21:32:55 +0200 Subject: Disabled fugitive file --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index b3f7a93..08f5cf7 100644 --- a/init.lua +++ b/init.lua @@ -78,6 +78,7 @@ local modules = { --"plugins.prettier", --"plugins.git", "plugins.lsp", + --"plugins.fugitive", "plugins.gitsigns", "plugins.neoscroll", "plugins.statuscol", -- cgit v1.2.3