-
Notifications
You must be signed in to change notification settings - Fork 0
/
defaults.lua
122 lines (111 loc) · 3.79 KB
/
defaults.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
vim.o.termguicolors = true
vim.env.NVIM_TUI_ENABLE_TRUE_COLOR = 1
vim.o.ttyfast = true
vim.o.autochdir = true
vim.o.exrc = true
vim.o.secure = false
vim.o.number = true
vim.o.relativenumber = true
vim.o.cursorline = true
vim.o.expandtab = false
vim.o.tabstop = 2
vim.o.smarttab = true
vim.o.shiftwidth = 2
vim.o.softtabstop = 2
vim.o.autoindent = true
vim.o.list = true
vim.o.listchars = 'tab:|\\ ,trail:▫'
vim.o.scrolloff = 7
vim.o.ttimeoutlen = 0
vim.o.timeout = false
vim.o.viewoptions = 'cursor,folds,slash,unix'
vim.o.wrap = true
vim.o.textwidth = 0
vim.o.indentexpr = ''
vim.o.foldmethod = 'indent'
vim.o.foldlevel = 99
vim.o.foldenable = true
vim.o.foldlevelstart = 99
vim.o.formatoptions = vim.o.formatoptions:gsub('tc', '')
vim.o.splitright = true
vim.o.splitbelow = true
vim.o.showmode = false
vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.shortmess = vim.o.shortmess .. 'c'
vim.o.inccommand = 'split'
vim.o.completeopt = 'longest,noinsert,menuone,noselect,preview'
vim.o.completeopt = 'menuone,noinsert,noselect,preview'
-- vim.o.lazyredraw = true
vim.o.visualbell = true
vim.o.colorcolumn = '100'
vim.o.updatetime = 100
vim.o.virtualedit = 'block'
vim.cmd([[
silent !mkdir -p $HOME/.config/nvim/tmp/backup
silent !mkdir -p $HOME/.config/nvim/tmp/undo
"silent !mkdir -p $HOME/.config/nvim/tmp/sessions
set backupdir=$HOME/.config/nvim/tmp/backup,.
set directory=$HOME/.config/nvim/tmp/backup,.
if has('persistent_undo')
set undofile
set undodir=$HOME/.config/nvim/tmp/undo,.
endif
]])
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { pattern = "*.md", command = "setlocal spell", })
vim.api.nvim_create_autocmd("BufEnter", { pattern = "*", command = "silent! lcd %:p:h", })
-- Automatically source the current file after saving
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*.lua",
command = "source %",
})
vim.cmd([[au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif]])
vim.cmd([[
au BufWritePost $MYVIMRC source $MYVIMRC
]])
vim.g.terminal_color_0 = '#000000'
vim.g.terminal_color_1 = '#FF5555'
vim.g.terminal_color_2 = '#50FA7B'
vim.g.terminal_color_3 = '#F1FA8C'
vim.g.terminal_color_4 = '#BD93F9'
vim.g.terminal_color_5 = '#FF79C6'
vim.g.terminal_color_6 = '#8BE9FD'
vim.g.terminal_color_7 = '#BFBFBF'
vim.g.terminal_color_8 = '#4D4D4D'
vim.g.terminal_color_9 = '#FF6E67'
vim.g.terminal_color_10 = '#5AF78E'
vim.g.terminal_color_11 = '#F4F99D'
vim.g.terminal_color_12 = '#CAA9FA'
vim.g.terminal_color_13 = '#FF92D0'
vim.g.terminal_color_14 = '#9AEDFE'
---- Configure UltiSnips
--vim.g.UltiSnipsSnippetDirectories = { 'UltiSnips', 'honza/vim-snippets' }
--vim.g.UltiSnipsExpandTrigger = '<Tab>'
--vim.g.UltiSnipsJumpForwardTrigger = '<c-j>'
--vim.g.UltiSnipsJumpBackwardTrigger = '<c-k>'
--vim.g.UltiSnipsSnippetStorageDirectoryForUltiSnipsEdit = '~/.config/nvim/UltiSnips/'
--
vim.cmd([[autocmd TermOpen term://* startinsert]])
vim.cmd([[
augroup NVIMRC
autocmd!
autocmd BufWritePost .lua exec ":so %"
augroup END
tnoremap <C-N> <C-\><C-N>
tnoremap <C-O> <C-\><C-N><C-O>
]])
vim.cmd([[hi NonText ctermfg=gray guifg=grey10]])
local config_path = vim.fn.stdpath("config")
local current_config_path = config_path .. "/lua/config/machine_specific.lua"
if not vim.loop.fs_stat(current_config_path) then
local current_config_file = io.open(current_config_path, "wb")
local default_config_path = config_path .. "/default_config/_machine_specific_default.lua"
local default_config_file = io.open(default_config_path, "rb")
if default_config_file and current_config_file then
local content = default_config_file:read("*all")
current_config_file:write(content)
io.close(default_config_file)
io.close(current_config_file)
end
end
require("config.machine_specific")