浏览代码

rough user config, not finished

Chris 4 年之前
父节点
当前提交
127ff7231a
共有 5 个文件被更改,包括 28 次插入25 次删除
  1. 2 1
      init.lua
  2. 1 1
      lua/colorscheme.lua
  3. 11 15
      lua/config.lua
  4. 1 1
      lua/nv-compe/init.lua
  5. 13 7
      lua/nv-globals.lua

+ 2 - 1
init.lua

@@ -1,6 +1,5 @@
 -- General mappings
 require('plugins')
-require('config')
 require('nv-utils')
 require('nv-globals')
 require('settings')
@@ -58,5 +57,7 @@ require('lsp.html-ls')
 require('lsp.efm-general-ls')
 require('lsp.virtual_text')
 
+-- Source config last
+require('config')
 -- vim.lsp.callbacks["textDocument/publishDiagnostics"] = function() end
 -- vim.lsp.handlers["textDocument/publishDiagnostics"] = nil

+ 1 - 1
lua/colorscheme.lua

@@ -1,3 +1,3 @@
 vim.cmd('let g:nvcode_termcolors=256')
 
-vim.cmd('colorscheme '..COLORSCHEME)
+vim.cmd('colorscheme ' .. O.colorscheme)

+ 11 - 15
lua/config.lua

@@ -1,21 +1,17 @@
-AUTO_COMPLETE=true
--- make list of languages
-AUTO_FORMAT=true
-
-COLORSCHEME='nvcode'
-
--- ideas
-
 --[[
+O is the global options object
 
-nv.lint.python='flake8'
-nv.format.python='black'
-nv.format.python='yapf'
-nv.format.python='autopep8'
-nv.format.tsserver='prettier'
-nv.format.tsserver='eslint'
+Formatters and linters should be
+filled in as strings with either
+a global executable or a path to
+an executable
+]]
 
 
-]]
+O.auto_complete = true
+O.colorscheme = 'nvcode'
 
+O.python.formatter = 'yapf'
+O.python.linter = nil
+O.python.autoformat = false
 

+ 1 - 1
lua/nv-compe/init.lua

@@ -1,7 +1,7 @@
 vim.o.completeopt = "menuone,noselect"
 
 require'compe'.setup {
-    enabled = AUTO_COMPLETE,
+    enabled = O.auto_complete,
     autocomplete = true,
     debug = false,
     min_length = 1,

+ 13 - 7
lua/nv-globals.lua

@@ -1,11 +1,17 @@
-local nv_options = {}
+O = {
 
-DATA_PATH = vim.fn.stdpath('data')
-CACHE_PATH = vim.fn.stdpath('cache')
-
-python = {
-linter = nil,
+    auto_complete = true,
+    colorscheme = 'nvcode',
+    python = {linter = nil, formatter = nil, autoformat = false},
+    javascript = {linter = nil, formatter = nil, autoformat = false},
+    javascriptreact = {linter = nil, formatter = nil, autoformat = false},
+    lua = {formatter = nil, autoformat = false},
+    bash = {linter = nil, formatter = nil, autoformat = false},
+    css = {formatter = nil, autoformat = false},
+    json = {formatter = nil, autoformat = false},
 
 }
 
-return nv_options
+DATA_PATH = vim.fn.stdpath('data')
+CACHE_PATH = vim.fn.stdpath('cache')
+