diff --git a/README.md b/README.md
index 5e51330..8cc96b0 100644
--- a/README.md
+++ b/README.md
@@ -59,12 +59,9 @@ Lua fork of vim devicons which lets me change icons of filetypes
### nvim-treesitter
Better syntax highlighting for programming languages ( my config just has html,css,js support for now ).
-without Treesitter :
+without / with Treesitter :
-with Treesitter :
-
-
### nvim-base16 -
contains a collection of all base16 themes for vim , plugin written in lua (comparison of base16-vim and nvim-base16):
@@ -82,12 +79,13 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal
nvim
├──init.lua
└──lua
- └──foo
- └──lua.lua
+ └──anything.lua
```
- The init.lua is used instead of init.vim.
-- The lua folder contains modules , in the example above "foo" could be considered as a module and it contains a lua.lua file in which you could write your config in lua , its like splitting the overall config into small bit . To load/source that "foo" module , you need to specify it in init.lua like this : require('foo.lua').
+- The lua folder contains modules ( config files ) , in the example above anything.lua file in lua folder could be considered as a module.
+- The anything.lua file is supposed to have any neovim config written in lua , its like splitting the overall config into small bits and make it more organized , like one module for highlights and colors , another one for statusline and so on!.
+- To load or source that "anything" module (like making it load with init.lua ) ,add this is in init.lua : require "anything".
# Features
@@ -109,6 +107,7 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal
- packer.nvim as package manager
- indent-blankline.Nvim for indentlines
- smooth scrolling
+- Snip support from VSCode through vsnip supporting custom and predefined snips (friendly-snippets)
# Guides to migrate your nvim configs to init.lua -
@@ -120,17 +119,24 @@ nvim-base16 doesnt even take time to load unlike base16-vim which was eating hal
- https://icyphox.sh/blog/nvim-lua/
+- https://github.com/rafamadriz/friendly-snippets/wiki
+
# Clone my setup -
- Install neovim-nightly , also use a nerdfont on your terminal.
-- run the install.sh (this might work only on nix systems) and open neovim , do :PackerInstall
-- or do it manually :
+- Use these [colors](https://github.com/siduck76/dotfiles/blob/master/thinkpad/.Xresources) for your terminal , Its in xresources format so it'd would be easier to use a terminal that supports xresources like st , urxvt , xterm , My [st build](https://github.com/siduck76/st).
+- run the install.sh (this might work only on nix systems),this opens neovim (press enter or y to skip the errors , the errors will only show once).
+- Install ripgrep , fd , ueberzug for telescope media extension to work.
+
+- Manual installation , incase the install.sh doesnt work for you :
- Install packer.nvim
-```shell
+```
+
git clone https://github.com/wbthomason/packer.nvim\
~/.local/share/nvim/site/pack/packer/start/packer.nvim
+
```
- copy lua folder and init.lua into ~/.config/nvim
@@ -138,7 +144,10 @@ git clone https://github.com/wbthomason/packer.nvim\
- Install language servers and prettier ( for autocompletion etc and code formatting , nodejs should be installed too!) , this usually depends on the language support you want to add in your neovim config.
```
-sudo npm install -g vscode-html-languageserver-bin typescript typescript-language-server vscode-css-languageserver-bin prettier
+npm config set prefix=~/.node_modules
+npm install -g vscode-html-languageserver-bin typescript typescript-language-server vscode-css-languageserver-bin prettier
+
+(ADD ~/.node_modules at your PATH)
```
To setup any language server , follow this guide https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md and search up the needed LSP. For example if I needed clangd's lsp server :
@@ -152,29 +161,61 @@ I'd install it first and add its setup line :
require'lspconfig'.clangd.setup{} ``
-# Default Mappings to make stuffs easier!
+# Default Mappings
- space is the leader key
+ space is the **leader** key.
+- Opening terminals!
- Ctrl l Open terminal vertically over right
- Ctrl x Open terminal horizontally below the current window
+
+- **File tree (nvim-tree)**
+
- Ctrl n toggle neovim tree
+
+- Shift h show hidden files (use these keybinds when cursor's in the filetree, same for the keybinds below).
+- Ctrl + v open files in vertical split
+- Ctrl + x open files in horizontal split
+
+- **Toggling stuffs**
+
+- leader + n toggle line number
+- leader + z toggle truezen.nvim's Ataraxis mode
+- leader + m toggle truezen.nvim's minimalistic mode
+
+- **Copy text**
+
- Ctrl a copies everything in the current file
- select any text + y copies the selected text
-- leader + f b open all buffers , with telescope
-- leader + f p search and preview images with telescope
-- leader + f f find files in the current DIR , with telescope
-- leader + f o open recently edited files , with telescope
-- leader + f f find files in the current DIR , with telescope
-- leader + f h opens up a manpage like thing but for all vim related things , with telescope
+
+- **Telescope**
+
+- leader + f b open all buffers
+- leader + f f find files in the current DIR
+- leader + f o open recently edited files
+- leader + f h opens up a help page like thing
+- Ctrl + v open files in vertical split
+- Ctrl + x open files in horizontal split
+
+- **Formatting code**
+
- leader + f m formats or beautifies the code in current window via neoformat
- (currently only html ,css , js can be formatted . To be able to use this keybind you need to install the formatter locally for your language , in my case prettier was required only so I installed it. check this https://github.com/sbdchd/neoformat).
+ (currently only html ,css , js can be formatted . To be able to use this keybind you need to install the formatter locally for your language , in my case prettier was required only so I installed it. check (this)[https://github.com/sbdchd/neoformat].
+
+- **Neoscroll**
+
- ``, ``, ``, ``, `` and `` : Smooth scrolling for window movement commands.
+- **Managing tabs with bufferline!**
+
+- Shift l or s cycle through opened tabs
+- Shift d close current tab
+- Shift b open new tab
+
# TODO
-- add snippets support
-- show statusline in inactive windows
+- Make the statusline more elegant.
+- Add more themes.
# Contact -
diff --git a/init.lua b/init.lua
index 50f7e69..82b9bda 100644
--- a/init.lua
+++ b/init.lua
@@ -1,25 +1,23 @@
-- load all plugins
-require("pluginsList.lua")
-require("file-icons.lua")
+require "pluginList"
+require "file-icons"
-require("misc-utils.lua")
-require("nvimTree.lua")
-require("bufferline.lua")
-require("statusline.lua")
-require("telescope.lua")
+require "misc-utils"
+require "top-bufferline"
+require "statusline"
-require("gitsigns.lua")
-require "colorizer".setup()
+require("colorizer").setup()
+require("neoscroll").setup() -- smooth scroll
-- lsp
-require("lspconfig.lua")
-require("compe.lua")
+require "nvim-lspconfig"
+require "compe-completion"
local cmd = vim.cmd
local g = vim.g
g.mapleader = " "
-g.auto_save = 1
+g.auto_save = 0
-- colorscheme related stuff
@@ -36,7 +34,7 @@ local indent = 2
g.indentLine_enabled = 1
g.indent_blankline_char = "▏"
-cmd("hi IndentBlanklineChar guifg=#2a2e36")
+cmd "hi IndentBlanklineChar guifg=#2a2e36"
g.indent_blankline_filetype_exclude = {"help", "terminal"}
g.indent_blankline_buftype_exclude = {"terminal"}
@@ -44,43 +42,29 @@ g.indent_blankline_buftype_exclude = {"terminal"}
g.indent_blankline_show_trailing_blankline_indent = false
g.indent_blankline_show_first_indent_level = false
-require("treesitter.lua")
-require("mappings.lua")
+require "treesitter-nvim"
+require "mappings"
-- highlights --
-cmd("hi LineNr guifg=#383c44 guibg=NONE")
-cmd("hi Comment guifg=#3d4149")
+cmd "hi LineNr guifg=#42464e guibg=NONE"
+cmd "hi Comment guifg=#42464e"
-cmd("hi SignColumn guibg=NONE")
-cmd("hi VertSplit guibg=NONE guifg=#2a2e36")
-cmd("hi DiffAdd guifg=#81A1C1 guibg = none")
-cmd("hi DiffChange guifg =#3A3E44 guibg = none")
-cmd("hi DiffModified guifg = #81A1C1 guibg = none")
-cmd("hi EndOfBuffer guifg=#1e222a")
+cmd "hi SignColumn guibg=NONE"
+cmd "hi VertSplit guibg=NONE guifg=#2a2e36"
+cmd "hi EndOfBuffer guifg=#1e222a"
+cmd "hi PmenuSel guibg=#98c379"
+cmd "hi Pmenu guibg=#282c34"
--- telescope stuff and popupmenu
-cmd("hi TelescopeBorder guifg=#2a2e36")
-cmd("hi TelescopePromptBorder guifg=#2a2e36")
-cmd("hi TelescopeResultsBorder guifg=#2a2e36")
-cmd("hi TelescopePreviewBorder guifg=#525865")
-cmd("hi PmenuSel guibg=#98c379")
-cmd("hi Pmenu guibg=#282c34")
+cmd "hi Normal guibg=NONE ctermbg=NONE"
+-- cmd "hi Normal guibg=#1e222a"
--- tree folder name , icon color
-cmd("hi NvimTreeFolderIcon guifg = #61afef")
-cmd("hi NvimTreeFolderName guifg = #61afef")
-cmd("hi NvimTreeIndentMarker guifg=#383c44")
-
-cmd("hi Normal guibg=NONE ctermbg=NONE")
+require "telescope-nvim"
+require "nvimTree"
+-- git signs , lsp symbols etc
+require "gitsigns-nvim"
require("nvim-autopairs").setup()
-require("lspkind").init(
- {
- File = " "
- }
-)
-
--- nvimTree bg color
+require("lspkind").init()
-- hide line numbers in terminal windows
vim.api.nvim_exec([[
@@ -90,5 +74,8 @@ vim.api.nvim_exec([[
-- inactive statuslines as thin splitlines
cmd("highlight! StatusLineNC gui=underline guibg=NONE guifg=#383c44")
--- smooth scroll
-require("neoscroll").setup()
+cmd "hi clear CursorLine"
+cmd "hi cursorlinenr guibg=NONE guifg=#abb2bf"
+
+-- setup for TrueZen.nvim
+require "zenmode"
diff --git a/install.sh b/install.sh
index 5a3108f..a71fa3d 100755
--- a/install.sh
+++ b/install.sh
@@ -2,22 +2,22 @@
BASE=$(git rev-parse --show-toplevel)
LSP_BIN_PATH=$HOME/.local/bin
-default_lsp_langs="css html ts rust python"
+default_lsp_langs="css html ts rust python bash"
lsp_langs=""
choose_langs() {
read -p "Would you like to install $1 lsp?(y/n)" lang
- if [ "$lang" = "y" ]
- then
+ if [ "$lang" = "y" ]; then
lsp_langs+="$1 "
fi
}
-for lang in $default_lsp_langs
-do
+for lang in $default_lsp_langs; do
choose_langs $lang
done
+npm config set prefix=~/.node_modules # for global npm pkg installation
+
pfx="~~~~~ "
heading() {
echo
@@ -26,11 +26,11 @@ heading() {
get_platform() {
case "$(uname -s)" in
- Linux*) platform=Linux;;
- Darwin*) platform=Mac;;
- CYGWIN*) platform=Cygwin;;
- MINGW*) platform=MinGw;;
- *) platform="UNKNOWN:${unameOut}"
+ Linux*) platform=Linux ;;
+ Darwin*) platform=Mac ;;
+ CYGWIN*) platform=Cygwin ;;
+ MINGW*) platform=MinGw ;;
+ *) platform="UNKNOWN:${unameOut}" ;;
esac
echo $platform
}
@@ -39,17 +39,29 @@ heading "installing packer"
if [[ ! -e ~/.local/share/nvim/site/pack/packer/start/packer.nvim ]]; then
heading "Installing packer"
- git clone https://github.com/wbthomason/packer.nvim\
+ git clone https://github.com/wbthomason/packer.nvim \
~/.local/share/nvim/site/pack/packer/start/packer.nvim
fi
heading "Linking config"
heading "old nvim config will be deleted so watchout :0"
-# copying config
+# copying config
rm -rf ~/.config/nvim/ && mkdir -p ~/.config/nvim
-cp -r init.lua ~/.config/nvim && cp -r lua ~/.config/nvim
+cp -r init.lua ~/.config/nvim && cp -r lua ~/.config/nvim
+
+# change shell for nvim
+read -p "which shell do you use?: " shellname
+echo "$shellname"
+
+if [ "$(get_platform)" = "Mac" ]; then
+ gsed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings/lua.lua
+else
+ sed -i "s/bash/$shellname/g" ~/.config/nvim/lua/mappings/lua.lua
+fi
+
+echo "shell changed to $shellname on nvim successfully!"
#for f in `find -E . -regex ".*\.vim$|.*\.lua$"`; do
# p=${f#*/}
@@ -65,24 +77,18 @@ cp -r init.lua ~/.config/nvim && cp -r lua ~/.config/nvim
#nvim --headless +TSUpdate +qa
echo
-fn_exists() { declare -F "$1" > /dev/null; }
+fn_exists() { declare -F "$1" >/dev/null; }
warn_path=false
-install_node_deps () {
+install_node_deps() {
if [[ -z $(which npm) ]]; then
echo "npm not installed"
return
fi
- sudo npm install -g $@
+ npm install -g $@
}
-install_python_deps () {
- if [[ -z $(which pip) && -z $(which pip3) ]]; then
- echo "python/pip not installed"
- return
- fi
- sudo python3 -m pip install $@
-}
+# install languages
install_ts() {
install_node_deps typescript typescript-language-server prettier
@@ -107,21 +113,31 @@ install_rust() {
fi
}
-install_python(){
- install_python_deps 'python-language-server[all]'
+install_python() {
+ install_node_deps pyright
+}
+
+install_bash() {
+ install_node_deps bash-language-server
}
for lang in ${lsp_langs}; do
- if fn_exists install_$lang ; then
+ if fn_exists install_$lang; then
heading "Installing $lang language server"
install_$lang
else
echo $lang setup not implemented
- echo
+ echo
fi
done
-if [[ ${warn_path} = true ]]; then
+if [[ ${warn_path} == true ]]; then
echo ""
echo "Ensure ${LSP_BIN_PATH} is available in your \$PATH variable"
fi
+
+echo "add ~/.node_modules/bin at PATH!"
+
+# install all plugins via packer
+
+nvim +PackerInstall
diff --git a/lua/compe/lua.lua b/lua/compe-completion.lua
similarity index 94%
rename from lua/compe/lua.lua
rename to lua/compe-completion.lua
index d65845b..0fa3ecd 100644
--- a/lua/compe/lua.lua
+++ b/lua/compe-completion.lua
@@ -1,6 +1,3 @@
-vim.cmd [[packadd nvim-lspconfig]]
-vim.cmd [[packadd nvim-compe]]
-
vim.o.completeopt = "menuone,noselect"
require "compe".setup {
@@ -18,9 +15,9 @@ require "compe".setup {
documentation = true,
source = {
path = true,
- buffer = true,
+ buffer = {kind = "" , true},
calc = true,
- vsnip = true,
+ vsnip = {kind = ""}, --replace to what sign you prefer
nvim_lsp = true,
nvim_lua = true,
spell = true,
diff --git a/lua/file-icons/lua.lua b/lua/file-icons.lua
similarity index 90%
rename from lua/file-icons/lua.lua
rename to lua/file-icons.lua
index 52acffe..59807a9 100644
--- a/lua/file-icons/lua.lua
+++ b/lua/file-icons.lua
@@ -1,5 +1,3 @@
-vim.cmd [[packadd nvim-web-devicons]]
-
require "nvim-web-devicons".setup {
override = {
html = {
@@ -96,6 +94,16 @@ require "nvim-web-devicons".setup {
icon = "",
color = "#EBCB8B",
name = "xz"
+ },
+ deb = {
+ icon = "",
+ color = "#a3b8ef",
+ name = "deb"
+ },
+ rpm = {
+ icon = "",
+ color = "#fca2aa",
+ name = "rpm"
}
}
}
diff --git a/lua/gitsigns/lua.lua b/lua/gitsigns-nvim.lua
similarity index 88%
rename from lua/gitsigns/lua.lua
rename to lua/gitsigns-nvim.lua
index 1fa4325..83bf7d7 100644
--- a/lua/gitsigns/lua.lua
+++ b/lua/gitsigns-nvim.lua
@@ -25,3 +25,9 @@ require("gitsigns").setup {
sign_priority = 5,
status_formatter = nil -- Use default
}
+
+local cmd = vim.cmd
+
+cmd "hi DiffAdd guifg=#81A1C1 guibg = none"
+cmd "hi DiffChange guifg =#3A3E44 guibg = none"
+cmd "hi DiffModified guifg = #81A1C1 guibg = none"
diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua
deleted file mode 100644
index a5eb803..0000000
--- a/lua/lspconfig/lua.lua
+++ /dev/null
@@ -1,45 +0,0 @@
-vim.cmd [[packadd nvim-lspconfig]]
-vim.cmd [[packadd nvim-compe]]
-
-local nvim_lsp = require("lspconfig")
-
-function on_attach(client)
- local function buf_set_keymap(...)
- vim.api.nvim_buf_set_keymap(bufnr, ...)
- end
- local function buf_set_option(...)
- vim.api.nvim_buf_set_option(bufnr, ...)
- end
-
- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
-
- -- Mappings.
- local opts = {noremap = true, silent = true}
- buf_set_keymap("n", "gD", "lua vim.lsp.buf.declaration()", opts)
- buf_set_keymap("n", "gd", "lua vim.lsp.buf.definition()", opts)
- buf_set_keymap("n", "K", "lua vim.lsp.buf.hover()", opts)
- buf_set_keymap("n", "gi", "lua vim.lsp.buf.implementation()", opts)
- buf_set_keymap("n", "", "lua vim.lsp.buf.signature_help()", opts)
- buf_set_keymap("n", "wa", "lua vim.lsp.buf.add_workspace_folder()", opts)
- buf_set_keymap("n", "wr", "lua vim.lsp.buf.remove_workspace_folder()", opts)
- buf_set_keymap("n", "wl", "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))", opts)
- buf_set_keymap("n", "D", "lua vim.lsp.buf.type_definition()", opts)
- buf_set_keymap("n", "rn", "lua vim.lsp.buf.rename()", opts)
- buf_set_keymap("n", "gr", "lua vim.lsp.buf.references()", opts)
- buf_set_keymap("n", "e", "lua vim.lsp.diagnostic.show_line_diagnostics()", opts)
- buf_set_keymap("n", "[d", "lua vim.lsp.diagnostic.goto_prev()", opts)
- buf_set_keymap("n", "]d", "lua vim.lsp.diagnostic.goto_next()", opts)
- buf_set_keymap("n", "q", "lua vim.lsp.diagnostic.set_loclist()", opts)
-
- -- Set some keybinds conditional on server capabilities
- if client.resolved_capabilities.document_formatting then
- buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts)
- elseif client.resolved_capabilities.document_range_formatting then
- buf_set_keymap("n", "f", "lua vim.lsp.buf.range_formatting()", opts)
- end
-end
-
-local servers = {"tsserver", "cssls", "html" , "pyls"}
-for _, lsp in ipairs(servers) do
- nvim_lsp[lsp].setup {on_attach = on_attach}
-end
diff --git a/lua/mappings/lua.lua b/lua/mappings.lua
similarity index 53%
rename from lua/mappings/lua.lua
rename to lua/mappings.lua
index aa3b5df..a4d9222 100644
--- a/lua/mappings/lua.lua
+++ b/lua/mappings.lua
@@ -6,6 +6,17 @@ local function map(mode, lhs, rhs, opts)
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
end
+local opt = {}
+
+-- dont copy any deleted text , this is disabled by default so uncomment the below mappings if you want them!
+--[[
+
+map("n", "dd", [=[ "_dd ]=], opt)
+map("v", "dd", [=[ "_dd ]=], opt)
+map("v", "x", [=[ "_x ]=], opt)
+
+]]
+
-- copy any selected text with pressing y
map("", "c", '"+y')
@@ -15,3 +26,11 @@ map("n", "", [[ split term://bash | resize 10 ]], opt) -- open ter
-- COPY EVERYTHING --
map("n", "", [[ %y+]], opt)
+
+-- toggle numbers ---
+map("n", "n", [[ set nu!]], opt)
+
+-- toggle truezen.nvim's ataraxis and minimalist mode
+map("n", "z", [[ TZAtaraxis]], opt)
+map("n", "m", [[ TZMinimalist]], opt)
+
diff --git a/lua/misc-utils/lua.lua b/lua/misc-utils.lua
similarity index 85%
rename from lua/misc-utils/lua.lua
rename to lua/misc-utils.lua
index 9286b5f..8ccdfd4 100644
--- a/lua/misc-utils/lua.lua
+++ b/lua/misc-utils.lua
@@ -14,19 +14,19 @@ opt("o", "splitright", true)
opt("o", "termguicolors", true)
opt("w", "number", true)
opt("o", "numberwidth", 2)
+opt("w", "cul", true)
opt("o", "mouse", "a")
opt("w", "signcolumn", "yes")
opt("o", "cmdheight", 1)
-opt("o", "updatetime", 250) -- update interval for gitsigns
+opt("o", "updatetime", 250) -- update interval for gitsigns
opt("o", "clipboard", "unnamedplus")
-- for indenline
-opt("b", "expandtab", true )
-opt("b", "shiftwidth", 2 )
-
+opt("b", "expandtab", true)
+opt("b", "shiftwidth", 2)
local M = {}
diff --git a/lua/nvim-lspconfig.lua b/lua/nvim-lspconfig.lua
new file mode 100644
index 0000000..d8e2f59
--- /dev/null
+++ b/lua/nvim-lspconfig.lua
@@ -0,0 +1,100 @@
+function on_attach(client)
+ local function map(...)
+ vim.api.nvim_buf_set_keymap(bufnr, ...)
+ end
+
+ local function buf_set_option(...)
+ vim.api.nvim_buf_set_option(bufnr, ...)
+ end
+
+ buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
+
+ -- Mappings.
+ local opts = {noremap = true, silent = true, normal = true}
+ map("gD", "lua vim.lsp.buf.declaration()", opts)
+ map("gd", "lua vim.lsp.buf.definition()", opts)
+ map("K", "lua vim.lsp.buf.hover()", opts)
+ map("gi", "lua vim.lsp.buf.implementation()", opts)
+ map("", "lua vim.lsp.buf.signature_help()", opts)
+ map("wa", "lua vim.lsp.buf.add_workspace_folder()", opts)
+ map("wr", "lua vim.lsp.buf.remove_workspace_folder()", opts)
+ map("wl", "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))", opts)
+ map("D", "lua vim.lsp.buf.type_definition()", opts)
+ map("rn", "lua vim.lsp.buf.rename()", opts)
+ map("gr", "lua vim.lsp.buf.references()", opts)
+ map("e", "lua vim.lsp.diagnostic.show_line_diagnostics()", opts)
+ map("[d", "lua vim.lsp.diagnostic.goto_prev()", opts)
+ map("]d", "lua vim.lsp.diagnostic.goto_next()", opts)
+ map("q", "lua vim.lsp.diagnostic.set_loclist()", opts)
+
+ -- Set some keybinds conditional on server capabilities
+ if client.resolved_capabilities.document_formatting then
+ map("f", "lua vim.lsp.buf.formatting()", opts)
+ elseif client.resolved_capabilities.document_range_formatting then
+ map("f", "lua vim.lsp.buf.range_formatting()", opts)
+ end
+end
+
+local lspconf = require "lspconfig"
+local servers = {"html", "cssls", "tsserver", "pyright", "bashls"}
+
+for k, lang in pairs(servers) do
+ lspconf[lang].setup {
+ root_dir = vim.loop.cwd
+ }
+end
+
+-- lua lsp settings
+USER = "/home/" .. vim.fn.expand("$USER")
+
+local sumneko_root_path = USER .. "/.config/lua-language-server"
+local sumneko_binary = USER .. "/.config/lua-language-server/bin/Linux/lua-language-server"
+
+require "lspconfig".sumneko_lua.setup {
+ cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"},
+ root_dir = function()
+ return vim.loop.cwd()
+ end,
+ settings = {
+ Lua = {
+ runtime = {
+ version = "LuaJIT",
+ path = vim.split(package.path, ";")
+ },
+ diagnostics = {
+ globals = {"vim"}
+ },
+ workspace = {
+ library = {
+ [vim.fn.expand("$VIMRUNTIME/lua")] = true,
+ [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true
+ }
+ },
+ telemetry = {
+ enable = false
+ }
+ }
+ }
+}
+
+-- replace the default lsp diagnostic letters with prettier symbols
+vim.fn.sign_define("LspDiagnosticsSignError", {text = "", numhl = "LspDiagnosticsDefaultError"})
+vim.fn.sign_define("LspDiagnosticsSignWarning", {text = "", numhl = "LspDiagnosticsDefaultWarning"})
+vim.fn.sign_define("LspDiagnosticsSignInformation", {text = "", numhl = "LspDiagnosticsDefaultInformation"})
+vim.fn.sign_define("LspDiagnosticsSignHint", {text = "", numhl = "LspDiagnosticsDefaultHint"})
+
+-- diagnostics highlights
+
+local cmd = vim.cmd
+
+cmd "hi LspDiagnosticsSignError guifg=#f9929b"
+cmd "hi LspDiagnosticsVirtualTextError guifg=#BF616A"
+
+cmd "hi LspDiagnosticsSignWarning guifg=#EBCB8B"
+cmd "hi LspDiagnosticsVirtualTextWarning guifg=#EBCB8B"
+
+cmd "hi LspDiagnosticsSignInformation guifg=#A3BE8C"
+cmd "hi LspDiagnosticsVirtualTextInformation guifg=#A3BE8C"
+
+cmd "hi LspDiagnosticsSignHint guifg=#b6bdca"
+cmd "hi LspDiagnosticsVirtualTextHint guifg=#b6bdca"
diff --git a/lua/nvimTree/lua.lua b/lua/nvimTree.lua
similarity index 93%
rename from lua/nvimTree/lua.lua
rename to lua/nvimTree.lua
index 34e671f..3090289 100644
--- a/lua/nvimTree/lua.lua
+++ b/lua/nvimTree.lua
@@ -1,9 +1,8 @@
-vim.cmd [[packadd nvim-tree.lua]]
+local cmd = vim.cmd
+local g = vim.g
vim.o.termguicolors = true
-local g = vim.g
-
g.nvim_tree_side = "left"
g.nvim_tree_width = 25
g.nvim_tree_ignore = {".git", "node_modules", ".cache"}
@@ -84,3 +83,7 @@ g.nvim_tree_bindings = {
["-"] = get_lua_cb("dir_up"),
["q"] = get_lua_cb("close")
}
+
+cmd "hi NvimTreeFolderIcon guifg = #61afef"
+cmd "hi NvimTreeFolderName guifg = #61afef"
+cmd "hi NvimTreeIndentMarker guifg=#383c44"
diff --git a/lua/pluginsList/lua.lua b/lua/pluginList.lua
similarity index 70%
rename from lua/pluginsList/lua.lua
rename to lua/pluginList.lua
index 0f4142c..09b2536 100644
--- a/lua/pluginsList/lua.lua
+++ b/lua/pluginList.lua
@@ -1,36 +1,47 @@
--- check if packer is installed (~/local/share/nvim/site/pack)
-local packer_exists = pcall(vim.cmd, [[packadd packer.nvim]])
+local packer = require("packer")
+local use = packer.use
--- using { } when using a different branch of the plugin or loading the plugin with certain commands
+-- using { } for using different branch , loading plugin with certain commands etc
return require("packer").startup(
function()
- use {"wbthomason/packer.nvim", opt = true}
- use {"lukas-reineke/indent-blankline.nvim", branch = "lua"}
+ use "wbthomason/packer.nvim"
+ -- color related stuff
use "norcalli/nvim-base16.lua"
- use "kyazdani42/nvim-web-devicons"
- use "kyazdani42/nvim-tree.lua"
+ use "norcalli/nvim-colorizer.lua"
+
+ -- lsp stuff
+ use "nvim-treesitter/nvim-treesitter"
+ use "neovim/nvim-lspconfig"
+ use "hrsh7th/nvim-compe"
+ use "onsails/lspkind-nvim"
+ use "sbdchd/neoformat"
use "nvim-lua/plenary.nvim"
+
use "lewis6991/gitsigns.nvim"
use "akinsho/nvim-bufferline.lua"
use "glepnir/galaxyline.nvim"
- use "907th/vim-auto-save"
- use "nvim-treesitter/nvim-treesitter"
- use "norcalli/nvim-colorizer.lua"
- use "ryanoasis/vim-devicons"
- use "sbdchd/neoformat"
- use "neovim/nvim-lspconfig"
- use "hrsh7th/nvim-compe"
use "windwp/nvim-autopairs"
use "alvan/vim-closetag"
- use "tweekmonster/startuptime.vim"
- use "onsails/lspkind-nvim"
+
+ -- snippet support
+ use "hrsh7th/vim-vsnip"
+ use "rafamadriz/friendly-snippets"
+
+ -- file managing , picker etc
+ use "kyazdani42/nvim-tree.lua"
+ use "kyazdani42/nvim-web-devicons"
+ use "ryanoasis/vim-devicons"
use "nvim-telescope/telescope.nvim"
use "nvim-telescope/telescope-media-files.nvim"
use "nvim-lua/popup.nvim"
- use "karb94/neoscroll.nvim"
- use "nekonako/xresources-nvim"
-
+ -- misc
+ use "tweekmonster/startuptime.vim"
+ use "907th/vim-auto-save"
+ use "karb94/neoscroll.nvim"
+ use "kdav5758/TrueZen.nvim"
+
+ use {"lukas-reineke/indent-blankline.nvim", branch = "lua"}
end
)
diff --git a/lua/statusline/lua.lua b/lua/statusline.lua
similarity index 100%
rename from lua/statusline/lua.lua
rename to lua/statusline.lua
diff --git a/lua/telescope/lua.lua b/lua/telescope-nvim.lua
similarity index 92%
rename from lua/telescope/lua.lua
rename to lua/telescope-nvim.lua
index b338935..744cb7b 100644
--- a/lua/telescope/lua.lua
+++ b/lua/telescope-nvim.lua
@@ -73,3 +73,12 @@ vim.api.nvim_set_keymap("n", "fb", [[lua require('telescope.builtin
vim.api.nvim_set_keymap("n", "fh", [[lua require('telescope.builtin').help_tags()]], opt)
vim.api.nvim_set_keymap("n", "fo", [[lua require('telescope.builtin').oldfiles()]], opt)
vim.api.nvim_set_keymap("n", "fm", [[ Neoformat]], opt)
+
+-- highlights
+
+local cmd = vim.cmd
+
+cmd "hi TelescopeBorder guifg=#2a2e36"
+cmd "hi TelescopePromptBorder guifg=#2a2e36"
+cmd "hi TelescopeResultsBorder guifg=#2a2e36"
+cmd "hi TelescopePreviewBorder guifg=#525865"
diff --git a/lua/bufferline/lua.lua b/lua/top-bufferline.lua
similarity index 59%
rename from lua/bufferline/lua.lua
rename to lua/top-bufferline.lua
index c661f69..707a8a2 100644
--- a/lua/bufferline/lua.lua
+++ b/lua/top-bufferline.lua
@@ -1,10 +1,12 @@
-vim.o.termguicolors = true
+-- colors
+
+local bar_fg = "#565c64"
+local activeBuffer_fg = "#c8ccd4"
--- colors for active , inactive uffer tabs
require "bufferline".setup {
options = {
buffer_close_icon = "",
- modified_icon = "●",
+ modified_icon = "",
close_icon = "",
left_trunc_marker = "",
right_trunc_marker = "",
@@ -18,29 +20,31 @@ require "bufferline".setup {
},
highlights = {
background = {
- guifg = comment_fg,
+ guifg = bar_fg,
guibg = "#1e222a"
},
fill = {
- guifg = comment_fg,
+ guifg = bar_fg,
guibg = "#1e222a"
},
+ -- focused window
buffer_selected = {
- guifg = normal_fg,
- guibg = "#282c34",
+ guifg = activeBuffer_fg,
+ guibg = "#353b45",
gui = "bold"
},
+ separator_selected = {
+ guifg = "#353b45",
+ guibg = "#353b45"
+ },
+ -- unfocused opened window
buffer_visible = {
- guifg = "#3e4451",
- guibg = "#1e222a"
+ guifg = "#9298a0",
+ guibg = "#282c34"
},
separator_visible = {
- guifg = "#1e222a",
- guibg = "#1e222a"
- },
- separator_selected = {
- guifg = "#1e222a",
- guibg = "#1e222a"
+ guifg = "#282c34",
+ guibg = "#282c34"
},
separator = {
guifg = "#1e222a",
@@ -51,7 +55,7 @@ require "bufferline".setup {
guibg = "#1e222a"
},
modified_selected = {
- guifg = string_fg,
+ guifg = "#d0f5c2",
guibg = "#353b45"
}
}
@@ -59,15 +63,15 @@ require "bufferline".setup {
local opt = {silent = true}
+local map = vim.api.nvim_set_keymap
vim.g.mapleader = " "
--command that adds new buffer and moves to it
-vim.api.nvim_command "com -nargs=? -complete=file_in_path New badd | blast"
-vim.api.nvim_set_keymap("n", "", ":New ", opt)
+map("n", "", [[tabnew]], opt)
--removing a buffer
-vim.api.nvim_set_keymap("n", "", [[bdelete]], opt)
+map("n", "", [[bdelete]], opt)
-- tabnew and tabprev
-vim.api.nvim_set_keymap("n", "", [[BufferLineCycleNext]], opt)
-vim.api.nvim_set_keymap("n", "", [[BufferLineCyclePrev]], opt)
+map("n", "", [[BufferLineCycleNext]], opt)
+map("n", "", [[BufferLineCyclePrev]], opt)
diff --git a/lua/treesitter/lua.lua b/lua/treesitter-nvim.lua
similarity index 74%
rename from lua/treesitter/lua.lua
rename to lua/treesitter-nvim.lua
index 1608a44..cebde4f 100644
--- a/lua/treesitter/lua.lua
+++ b/lua/treesitter-nvim.lua
@@ -6,9 +6,11 @@ ts_config.setup {
"html",
"css",
"bash",
- "cpp",
- "rust",
- "lua"
+ "lua",
+ "json",
+ "python"
+ -- "cpp",
+ -- "rust",
},
highlight = {
enable = true,
diff --git a/lua/zenmode.lua b/lua/zenmode.lua
new file mode 100644
index 0000000..6f985db
--- /dev/null
+++ b/lua/zenmode.lua
@@ -0,0 +1,47 @@
+local true_zen = require("true-zen")
+
+true_zen.setup(
+ {
+ true_false_commands = false,
+ cursor_by_mode = false,
+ before_minimalist_mode_shown = true,
+ before_minimalist_mode_hidden = true,
+ after_minimalist_mode_shown = true,
+ after_minimalist_mode_hidden = true,
+ bottom = {
+ hidden_laststatus = 0,
+ hidden_ruler = false,
+ hidden_showmode = false,
+ hidden_showcmd = false,
+ hidden_cmdheight = 1,
+ shown_laststatus = 2,
+ shown_ruler = true,
+ shown_showmode = false,
+ shown_showcmd = false,
+ shown_cmdheight = 1
+ },
+ top = {
+ hidden_showtabline = 0,
+ shown_showtabline = 2
+ },
+ left = {
+ hidden_number = false,
+ hidden_relativenumber = false,
+ hidden_signcolumn = "no",
+ shown_number = true,
+ shown_relativenumber = false,
+ shown_signcolumn = "no"
+ },
+ ataraxis = {
+ just_do_it_for_me = false,
+ left_padding = 37,
+ right_padding = 37,
+ top_padding = 2,
+ bottom_padding = 2,
+ custome_bg = "#1e222a"
+ },
+ integrations = {
+ integration_galaxyline = true
+ }
+ }
+)