summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lua/user/cmp.lua2
-rw-r--r--lua/user/colorscheme.lua7
-rw-r--r--lua/user/keymaps.lua14
-rw-r--r--lua/user/lsp/lsp-installer.lua5
-rw-r--r--lua/user/lsp/settings/jsonls.lua1
-rw-r--r--lua/user/lsp/settings/pyright.lua10
-rw-r--r--lua/user/options.lua8
-rw-r--r--lua/user/plugins.lua1
8 files changed, 35 insertions, 13 deletions
diff --git a/lua/user/cmp.lua b/lua/user/cmp.lua
index a151214..0ba1fc7 100644
--- a/lua/user/cmp.lua
+++ b/lua/user/cmp.lua
@@ -102,6 +102,7 @@ cmp.setup {
-- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
vim_item.menu = ({
nvim_lsp = "[LSP]",
+ nvim_lua = "[NVIM_LUA]",
luasnip = "[Snippet]",
buffer = "[Buffer]",
path = "[Path]",
@@ -111,6 +112,7 @@ cmp.setup {
},
sources = {
{ name = "nvim_lsp" },
+ { name = "nvim_lua" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
diff --git a/lua/user/colorscheme.lua b/lua/user/colorscheme.lua
index b1e21f6..4ccd3ff 100644
--- a/lua/user/colorscheme.lua
+++ b/lua/user/colorscheme.lua
@@ -6,3 +6,10 @@ catch /^Vim\%((\a\+)\)\=:E185/
set background=dark
endtry
]]
+local colorscheme = "default"
+
+local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
+if not status_ok then
+ vim.notify("colorscheme " .. colorscheme .. " not found!")
+ return
+end
diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua
index 28718bb..c7d10c4 100644
--- a/lua/user/keymaps.lua
+++ b/lua/user/keymaps.lua
@@ -6,9 +6,9 @@ local term_opts = { silent = true }
local keymap = vim.api.nvim_set_keymap
--Remap space as leader key
-keymap("", "<Space>", "<Nop>", opts)
-vim.g.mapleader = " "
-vim.g.maplocalleader = " "
+-- keymap("", "<Space>", "<Nop>", opts)
+vim.g.mapleader = ","
+vim.g.maplocalleader = ","
-- Modes
-- normal_mode = "n",
@@ -28,8 +28,8 @@ keymap("n", "<C-l>", "<C-w>l", opts)
keymap("n", "<leader>e", ":Lex 30<cr>", opts)
-- Resize with arrows
-keymap("n", "<C-Up>", ":resize -2<CR>", opts)
-keymap("n", "<C-Down>", ":resize +2<CR>", opts)
+keymap("n", "<C-Up>", ":resize +2<CR>", opts)
+keymap("n", "<C-Down>", ":resize -2<CR>", opts)
keymap("n", "<C-Left>", ":vertical resize -2<CR>", opts)
keymap("n", "<C-Right>", ":vertical resize +2<CR>", opts)
@@ -37,10 +37,6 @@ keymap("n", "<C-Right>", ":vertical resize +2<CR>", opts)
keymap("n", "<S-l>", ":bnext<CR>", opts)
keymap("n", "<S-h>", ":bprevious<CR>", opts)
--- Move text up and down
-keymap("n", "<A-j>", "<Esc>:m .+1<CR>==gi", opts)
-keymap("n", "<A-k>", "<Esc>:m .-2<CR>==gi", opts)
-
-- Insert --
-- Press jk fast to enter
keymap("i", "jk", "<ESC>", opts)
diff --git a/lua/user/lsp/lsp-installer.lua b/lua/user/lsp/lsp-installer.lua
index 2fe4af2..f539050 100644
--- a/lua/user/lsp/lsp-installer.lua
+++ b/lua/user/lsp/lsp-installer.lua
@@ -21,6 +21,11 @@ lsp_installer.on_server_ready(function(server)
opts = vim.tbl_deep_extend("force", sumneko_opts, opts)
end
+ if server.name == "pyright" then
+ local pyright_opts = require("user.lsp.settings.pyright")
+ opts = vim.tbl_deep_extend("force", pyright_opts, opts)
+ end
+
-- This setup() function is exactly the same as lspconfig's setup function.
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
server:setup(opts)
diff --git a/lua/user/lsp/settings/jsonls.lua b/lua/user/lsp/settings/jsonls.lua
index 8ee9544..be362c9 100644
--- a/lua/user/lsp/settings/jsonls.lua
+++ b/lua/user/lsp/settings/jsonls.lua
@@ -1,3 +1,4 @@
+-- Find more schemas here: https://www.schemastore.org/json/
local schemas = {
{
description = "TypeScript compiler configuration file",
diff --git a/lua/user/lsp/settings/pyright.lua b/lua/user/lsp/settings/pyright.lua
new file mode 100644
index 0000000..6354274
--- /dev/null
+++ b/lua/user/lsp/settings/pyright.lua
@@ -0,0 +1,10 @@
+return {
+ settings = {
+
+ python = {
+ analysis = {
+ typeCheckingMode = "off"
+ }
+ }
+ },
+}
diff --git a/lua/user/options.lua b/lua/user/options.lua
index 6b38e23..cf23784 100644
--- a/lua/user/options.lua
+++ b/lua/user/options.lua
@@ -7,16 +7,16 @@ local options = {
fileencoding = "utf-8", -- the encoding written to a file
hlsearch = true, -- highlight all matches on previous search pattern
ignorecase = true, -- ignore case in search patterns
- mouse = "a", -- allow the mouse to be used in neovim
+ mouse = "", -- allow the mouse to be used in neovim
pumheight = 10, -- pop up menu height
- showmode = false, -- we don't need to see things like -- INSERT -- anymore
+ showmode = true, -- we don't need to see things like -- INSERT -- anymore
showtabline = 2, -- always show tabs
smartcase = true, -- smart case
smartindent = true, -- make indenting smarter again
splitbelow = true, -- force all horizontal splits to go below current window
splitright = true, -- force all vertical splits to go to the right of current window
swapfile = false, -- creates a swapfile
- -- termguicolors = true, -- set term gui colors (most terminals support this)
+ termguicolors = true, -- set term gui colors (most terminals support this)
timeoutlen = 1000, -- time to wait for a mapped sequence to complete (in milliseconds)
undofile = true, -- enable persistent undo
updatetime = 300, -- faster completion (4000ms default)
@@ -26,7 +26,7 @@ local options = {
tabstop = 2, -- insert 2 spaces for a tab
cursorline = true, -- highlight the current line
number = true, -- set numbered lines
- relativenumber = false, -- set relative numbered lines
+ relativenumber = true, -- set relative numbered lines
numberwidth = 4, -- set number column width to 2 {default 4}
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
wrap = false, -- display lines as one long line
diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua
index b173f9b..62104da 100644
--- a/lua/user/plugins.lua
+++ b/lua/user/plugins.lua
@@ -56,6 +56,7 @@ return packer.startup(function(use)
use "hrsh7th/cmp-cmdline" -- cmdline completions
use "saadparwaiz1/cmp_luasnip" -- snippet completions
use "hrsh7th/cmp-nvim-lsp"
+ use "hrsh7th/cmp-nvim-lua"
-- snippets
use "L3MON4D3/LuaSnip" --snippet engine