forked from nvim-lua/kickstart.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
61 lines (54 loc) · 1.82 KB
/
init.lua
File metadata and controls
61 lines (54 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
-- You can add your own plugins here or in other files in this directory!
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
vim.g.have_nerd_font = true
vim.o.relativenumber = true
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
local function copy_path(path_type)
local path_to_copy
local msg_suffix
if path_type == 'full' then
path_to_copy = vim.fn.expand '%:p'
msg_suffix = 'full path'
elseif path_type == 'relative' then
path_to_copy = vim.fn.expand '%:.'
msg_suffix = 'relative path'
elseif path_type == 'filename' then
path_to_copy = vim.fn.expand '%:t'
msg_suffix = 'filename'
else
print 'Invalid path type specified for copy_path'
return
end
vim.fn.setreg('+', path_to_copy)
print('Copied ' .. msg_suffix .. ' to clipboard')
end
vim.keymap.set('n', '<leader>cp', function()
copy_path 'full'
end, { desc = 'Copy full file path' })
vim.keymap.set('n', '<leader>cr', function()
copy_path 'relative'
end, { desc = 'Copy relative file path' })
vim.keymap.set('n', '<leader>cf', function()
copy_path 'filename'
end, { desc = 'Copy filename' })
require('guess-indent').setup {}
-- local lspconfig = require 'lspconfig'
-- lspconfig.ruby_lsp.setup {
-- init_options = {
-- formatter = 'standard',
-- linters = { 'standard' },
-- addonSettings = {
-- ['Ruby LSP Rails}'] = {
-- enablePendingMigrtationsPrompt = false,
-- },
-- },
-- },
-- }
---@module 'lazy'
---@type LazySpec
return {}