-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
92 lines (78 loc) · 2.21 KB
/
init.lua
File metadata and controls
92 lines (78 loc) · 2.21 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
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
-- neovim設定
-- author ozoramore
--- 各種環境変数などなど
-- vim.v[key] = value
require('util.option').setvals({
mapleader = ',',
-- netrw(filemanager)
netrw_banner = 0,
netrw_liststyle = 1,
netrw_sizestyle = 'H',
netrw_winsize = 10,
netrw_wiw = 1,
netrw_browse_split = 3,
netrw_timefmt = '%F %T%z',
netrw_dirhistmax = 0,
netrw_hide = 0,
})
-- vim.cmd[key](value)
require('util.option').setcmds({
language = 'en_US.utf-8',
colorscheme = 'omfg',
})
-- vim.opt[key] = value
require('util.option').setopts({
incsearch = true,
backup = false,
swapfile = false,
completeopt = { 'menu', 'menuone', 'noselect', 'popup' },
undodir = '$XDG_DATA_HOME/nvim/undo',
-- encoding,fileformat,language
encoding = 'utf-8',
fileencoding = 'utf-8',
fileencodings = { 'utf-8', 'sjis', 'iso-2022-jp', 'euc-jp', 'default' },
fileformat = 'unix',
fileformats = { 'unix', 'dos', 'mac' },
langmenu = 'C.utf-8',
helplang = { 'ja', 'en' },
-- fold
foldenable = true,
foldmethod = 'indent',
foldcolumn = '1',
foldlevel = 99,
-- style
cursorline = true,
ambiwidth = 'single',
number = true,
showmatch = true,
termguicolors = true,
laststatus = 3,
bg = 'dark',
list = true,
fillchars = { fold = ' ', foldopen = '┌', foldsep = '│', foldclose = '─' },
listchars = { tab = '>-', trail = '_', extends = '…', precedes = '…', nbsp = '␣' },
})
--- filetypeの紐付け
require('util.filetype').setup({
['cpp'] = { 'h', 'def', 'tbl', 'inc' },
})
--- filetypeごとのbuf option設定
require('util.filetype').config({
default = { tabstop = 4, expandtab = false },
config = {
markdown = { tabstop = 4, expandtab = true },
yaml = { tabstop = 2, expandtab = true },
json = { tabstop = 2, expandtab = true },
ruby = { tabstop = 2, expandtab = true },
rust = { tabstop = 4, expandtab = true },
zig = { tabstop = 4, expandtab = true },
},
})
-- FEP設定(OSごとに振り分け)
require('util.fep').setup()
--- フォーマッタ
vim.api.nvim_create_user_command('Format', require('util.format').exec, { nargs = 0 })
--- コードフォールディング
vim.api.nvim_create_autocmd('LspAttach', { callback = require('util.fold').set })
--- 外部プラグインのセットアップ
require('plugin').setup()