diff options
| author | srdusr <trevorgray@srdusr.com> | 2023-07-18 22:12:36 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2023-07-18 22:12:36 +0200 |
| commit | 7890d905df24db4947db45edc1c4c1bd60fbbd1b (patch) | |
| tree | 2d73d26c371f37553e119e4902880587d78b6cc9 /.config/nvim/lua/user | |
| parent | c859a2dccf16a2849f8fe8d9fe76515bf228a3c9 (diff) | |
| parent | 01e02751d178a92284b1dcfdcd9a4aa6220ec364 (diff) | |
| download | dotfiles-7890d905df24db4947db45edc1c4c1bd60fbbd1b.tar.gz dotfiles-7890d905df24db4947db45edc1c4c1bd60fbbd1b.zip | |
Merge commit '3ea9490ace845987a5af317e6d9e1d70cb34036f'
Diffstat (limited to '.config/nvim/lua/user')
| -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 |
4 files changed, 26 insertions, 6 deletions
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']") }) |
