-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
62 lines (51 loc) · 2.17 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
-- init.lua
-- Neovim-specific configuration
-- based on https://github.com/nicknisi/dotfiles
require("globals")
local utils = require("utils")
local termcodes = utils.termcodes
-- General
---------------------------------------------------------------------------------------------------
vim.cmd [[syntax on]]
vim.opt.mouse = "a" -- set mouse mode to all modes
-- install wl-clipboard on Wayland
-- install xclip on X11
-- MacOS clipboard OK
vim.opt.clipboard = "unnamedplus"
vim.opt.number = true -- show line numbers
vim.opt.showmode = true -- don't show which mode disabled for PowerLine
vim.opt.autoread = true -- Reread file when only modified externaly
vim.opt.cursorline = true
vim.opt.scrolloff = 3 -- set 3 lines to the cursors - when moving vertical
vim.opt.tabstop = 4 -- the visible width of tabs
vim.opt.softtabstop = 4 -- edit as if the tabs are 4 characters wide
vim.opt.shiftwidth = 4 -- number of spaces to use for indent and unindent
vim.opt.expandtab = true -- show line numbers
-- vim.opt.smarttab = true -- tab respects 'tabstop', 'shiftwidth', and 'softtabstop'
-- vim.opt.shiftround = true -- round indent to a multiple of 'shiftwidth'
vim.opt.hlsearch = true -- highlight search results
vim.opt.incsearch = true -- set incremental search, like modern browsers
-- toggle invisible characters
vim.opt.list = true
vim.opt.listchars = {
tab = " ",
trail = "⋅",
extends = "❯",
precedes = "❮"
}
-- timeout to sequence chars
vim.opt.timeoutlen = 1000
-- Mappings
---------------------------------------------------------------------------------------------------
vim.g.mapleader = ","
vim.keymap.set("n", "<F3>", function() vim.opt.number = (not vim.opt.number:get()) end)
-- Just a debugging
vim.keymap.set("n", "<leader>?", ":echo(\"<leader> works! It is set to <leader>\")<CR>")
-- insert lines
vim.keymap.set("n", "<C-j>", ":set paste<CR>m`o<Esc>``:set nopaste<CR>")
vim.keymap.set("n", "<C-k>", ":set paste<CR>m`O<Esc>``:set nopaste<CR>")
-- remove current search hightlight
vim.keymap.set("n", "<C-l>", ":noh<CR>")
---------------------------------------------------------------------------------------------------
require("plugins")
vim.cmd [[colorscheme jelleybeans]]