this repo has no description

more on the gitopen stuff

seth.computer 75b128f5 82d0a64b

verified
+41 -15
+1 -1
scripts/git-open.sh
··· 44 44 final_url="${final_url}#L${linerange}" 45 45 fi 46 46 47 - echo $final_url 47 + echo -n $final_url
+40 -14
vim/lvim/config.lua
··· 15 15 enabled = true, 16 16 }, 17 17 build = function() require("gitlab.server").build(true) end, 18 - config = function() require("gitlab").setup() end, 18 + config = function() 19 + require("gitlab").setup({ 20 + discussion_tree = { 21 + position = "bottom", 22 + }, 23 + }) 24 + end, 19 25 }, 20 26 } 21 27 22 28 -- Display 23 29 lvim.colorscheme = "solarized-flat" 24 30 vim.opt.background = "light" 31 + vim.opt.cmdheight = 2 -- more space in the neovim command line for displaying messages 25 32 26 33 -- Opts 27 34 lvim.format_on_save.enabled = true 28 35 vim.opt.relativenumber = true 36 + vim.opt.shiftwidth = 2 37 + vim.opt.tabstop = 2 29 38 30 39 -- Core plugin changes 31 40 lvim.builtin.nvimtree.setup.view.width = 40 ··· 38 47 lvim.builtin.which_key.mappings["w/"] = { ":vsp<cr>", "Split vertical", mode = { "n" } } 39 48 40 49 lvim.builtin.which_key.mappings["gO"] = { ":GitOpen<cr>", "Open file in github/gitlab", mode = { "n", "v" } } 41 - lvim.builtin.which_key.mappings["gL"] = { ":GitCopy<cr>", "Open file in github/gitlab", mode = { "n", "v" } } 50 + lvim.builtin.which_key.mappings["gL"] = { ":GitCopy<cr>", "Copy link to file in github/gitlab", mode = { "n", "v" } } 42 51 43 52 lvim.builtin.which_key.mappings["G"] = { 44 53 name = "Gitlab", ··· 72 81 end 73 82 74 83 -- Filetype based settings 75 - function SetLineWrapForTextFiles(opts) 76 - local ft = vim.bo[opts.buf].filetype 77 - -- print(DumpTable(opts, 10)) 78 - -- print(opts.buf, ft) 84 + function SetLineWrapForTextFiles(ft) 79 85 if ft == "" or ft == "markdown" or ft == "text" then 80 - -- print("SETTING THE WRAP!") 81 - vim.bo[opts.buf].wrap = true 82 - vim.bo[opts.buf].linebreak = true 83 - vim.bo[opts.buf].list = false 86 + -- print("setting wrap") 87 + vim.opt_local.wrap = true 88 + vim.opt_local.linebreak = true 89 + vim.opt_local.list = false 84 90 end 85 91 end 86 92 87 93 local myAuGroup = vim.api.nvim_create_augroup("MyGroup", { clear = true }) 88 94 lvim.autocommands = { 89 - { "FileType", { pattern = { "*" }, group = myAuGroup, callback = SetLineWrapForTextFiles } }, 90 - { "BufAdd", { pattern = { "*" }, group = myAuGroup, callback = SetLineWrapForTextFiles } }, 95 + { 96 + "FileType", { 97 + pattern = { "*" }, 98 + group = myAuGroup, 99 + callback = function(opts) 100 + -- print("---- FileType") 101 + -- DumpTable(opts, 20) 102 + SetLineWrapForTextFiles(opts.filetype) 103 + end 104 + } 105 + }, 106 + { "WinEnter", { 107 + pattern = { "*" }, 108 + group = myAuGroup, 109 + callback = function(opts) 110 + -- print("---- WinEnter") 111 + -- DumpTable(opts, 20) 112 + SetLineWrapForTextFiles() 113 + end 114 + } }, 91 115 } 92 116 93 117 -- Formatters ··· 114 138 -- Check if multiple lines are selected 115 139 if line1 ~= line2 then 116 140 lines = line1 .. "-" .. line2 141 + else 142 + lines = line1 117 143 end 118 144 119 145 local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1] ··· 134 160 vim.cmd(string.format("!%s | pbcopy", git_open_cmd)) 135 161 end 136 162 137 - vim.cmd [[command! -range GitOpen :lua Git_open(<line1>, <line2>)]] 138 - vim.cmd [[command! -range GitCopy :lua Git_copy(<line1>, <line2>)]] 163 + vim.cmd [[command! -range GitOpen :lua GitOpen(<line1>, <line2>)]] 164 + vim.cmd [[command! -range GitCopy :lua GitCopy(<line1>, <line2>)]]