tangled
alpha
login
or
join now
seth.computer
/
dotfiles
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
more on the gitopen stuff
seth.computer
2 years ago
75b128f5
82d0a64b
verified
This commit was signed with the committer's
known signature
.
seth.computer
SSH Key Fingerprint:
SHA256:l+TmfElcKWTGSvrmVQkRAqucAII4w28uPbCCkXB+x7o=
+41
-15
2 changed files
expand all
collapse all
unified
split
scripts
git-open.sh
vim
lvim
config.lua
+1
-1
scripts/git-open.sh
···
44
44
final_url="${final_url}#L${linerange}"
45
45
fi
46
46
47
47
-
echo $final_url
47
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
18
-
config = function() require("gitlab").setup() end,
18
18
+
config = function()
19
19
+
require("gitlab").setup({
20
20
+
discussion_tree = {
21
21
+
position = "bottom",
22
22
+
},
23
23
+
})
24
24
+
end,
19
25
},
20
26
}
21
27
22
28
-- Display
23
29
lvim.colorscheme = "solarized-flat"
24
30
vim.opt.background = "light"
31
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
36
+
vim.opt.shiftwidth = 2
37
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
41
-
lvim.builtin.which_key.mappings["gL"] = { ":GitCopy<cr>", "Open file in github/gitlab", mode = { "n", "v" } }
50
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
75
-
function SetLineWrapForTextFiles(opts)
76
76
-
local ft = vim.bo[opts.buf].filetype
77
77
-
-- print(DumpTable(opts, 10))
78
78
-
-- print(opts.buf, ft)
84
84
+
function SetLineWrapForTextFiles(ft)
79
85
if ft == "" or ft == "markdown" or ft == "text" then
80
80
-
-- print("SETTING THE WRAP!")
81
81
-
vim.bo[opts.buf].wrap = true
82
82
-
vim.bo[opts.buf].linebreak = true
83
83
-
vim.bo[opts.buf].list = false
86
86
+
-- print("setting wrap")
87
87
+
vim.opt_local.wrap = true
88
88
+
vim.opt_local.linebreak = true
89
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
89
-
{ "FileType", { pattern = { "*" }, group = myAuGroup, callback = SetLineWrapForTextFiles } },
90
90
-
{ "BufAdd", { pattern = { "*" }, group = myAuGroup, callback = SetLineWrapForTextFiles } },
95
95
+
{
96
96
+
"FileType", {
97
97
+
pattern = { "*" },
98
98
+
group = myAuGroup,
99
99
+
callback = function(opts)
100
100
+
-- print("---- FileType")
101
101
+
-- DumpTable(opts, 20)
102
102
+
SetLineWrapForTextFiles(opts.filetype)
103
103
+
end
104
104
+
}
105
105
+
},
106
106
+
{ "WinEnter", {
107
107
+
pattern = { "*" },
108
108
+
group = myAuGroup,
109
109
+
callback = function(opts)
110
110
+
-- print("---- WinEnter")
111
111
+
-- DumpTable(opts, 20)
112
112
+
SetLineWrapForTextFiles()
113
113
+
end
114
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
141
+
else
142
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
137
-
vim.cmd [[command! -range GitOpen :lua Git_open(<line1>, <line2>)]]
138
138
-
vim.cmd [[command! -range GitCopy :lua Git_copy(<line1>, <line2>)]]
163
163
+
vim.cmd [[command! -range GitOpen :lua GitOpen(<line1>, <line2>)]]
164
164
+
vim.cmd [[command! -range GitCopy :lua GitCopy(<line1>, <line2>)]]