-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
75 lines (63 loc) · 2.05 KB
/
init.lua
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
-- vim: set et ts=2 sw=2:
--
-- disable netrw in favour of nvim-tree
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.g.netrw_liststyle = 3
vim.o.fileencodings = 'utf-8,cp1251,default'
vim.o.wildmode = 'longest,list,full'
vim.o.diffopt = vim.o.diffopt .. ',iwhite'
vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.tabstop = 4
vim.o.cindent = true
vim.o.shiftwidth = 4
vim.o.cinoptions = ":0,=1s,g0,M1,U0,u0,N-s"
vim.o.copyindent = true
vim.o.expandtab = true
vim.o.hidden = false
vim.o.autowrite = true
vim.o.mouse = 'n'
vim.o.termguicolors = true
vim.o.completeopt = 'menu,preview'
vim.o.shortmess = 'ac'
if vim.fn.has('win32') == 1 then
-- 'shellslash' may be necessary for lsp to detect workspace directories
-- (for lua specifically)
vim.o.shellslash = false
end
vim.g.mapleader = ' '
vim.g.maplocalleader = '\\'
vim.o.lazyredraw = true
vim.o.laststatus = 2
vim.o.showbreak = '\\' --↪
vim.o.undofile = true
vim.o.keymap = 'uk'
vim.o.iminsert = 0
vim.o.imsearch = 0
vim.api.nvim_create_autocmd("UIEnter", {
callback = function()
-- Neovide GUI
if vim.g.neovide then
vim.g.neovide_cursor_animation_length = 0.1
vim.g.neovide_cursor_trail_size = 0.0
vim.o.guifont = "VictorMono NF:h24"
-- Compatibility mappings for children
-- Copy selected text with Ctrl-Shift-C
vim.api.nvim_set_keymap("v", "<C-S-c>", '"+y', { noremap = true, silent = true })
-- Paste with Ctrl-Shift-V
vim.api.nvim_set_keymap("i", "<C-S-v>", '<C-r>+', { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<C-S-v>", '"+P', { noremap = true, silent = true })
vim.api.nvim_set_keymap("v", "<C-S-v>", '"+P', { noremap = true, silent = true })
end
end
})
-- Forget about ex mode
vim.keymap.set('', 'Q', function() end)
-- Find tailing white spaces
vim.keymap.set('n', '<Leader><space>', [[/\s\+$\| \+\ze\t<cr>]], { noremap = true })
-- Copy everything to the clipboard
vim.keymap.set('n', '<leader>yy', [[:%y+<cr>]], { noremap = true })
require'local.digraphs'
require'local.autocmds'
require'config.lazy'