Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoyoda75 committed Nov 26, 2023
0 parents commit f1cccd1
Show file tree
Hide file tree
Showing 24 changed files with 4,828 additions and 0 deletions.
1 change: 1 addition & 0 deletions nvim/after/plugin/fugitive.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vim.keymap.set("n", "<leader>gs", vim.cmd.Git);
10 changes: 10 additions & 0 deletions nvim/after/plugin/harpoon.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
local mark = require('harpoon.mark')
local ui = require('harpoon.ui')

vim.keymap.set("n", "<leader>a", mark.add_file)
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)

vim.keymap.set("n", "<leader>1", function() ui.nav_file(1) end)
vim.keymap.set("n", "<leader>2", function() ui.nav_file(2) end)
vim.keymap.set("n", "<leader>3", function() ui.nav_file(3) end)
vim.keymap.set("n", "<leader>4", function() ui.nav_file(4) end)
68 changes: 68 additions & 0 deletions nvim/after/plugin/lsp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
local lsp_zero = require('lsp-zero')

lsp_zero.on_attach(function(client, bufnr)
lsp_zero.default_keymaps({ buffer = bufnr })
end)

require('mason').setup({})
require('mason-lspconfig').setup({
ensure_installed = { 'pylsp', 'emmet_language_server', 'eslint', 'lua_ls' },
handlers = {
lsp_zero.default_setup,
lua_ls = function()
require('lspconfig').lua_ls.setup(lsp_zero.nvim_lua_ls())
end,
pylsp = function()
require('lspconfig').pylsp.setup {
filetypes = { 'python' },
settings = {
pylsp = {
plugins = {
jedi_signature_help = { enabled = true },
-- Auto-completion
jedi_completion = {
include_params = true,
fuzzy = true,
},
-- Type checker
pylsp_mypy = { enabled = true },
-- Import sorting
pylsp_isort = {
enabled = true,
args = { '--profile black' }
},
-- Linter
pylint = {
enabled = true,
executable = 'pylint'
},
args = {
"--ignore=missing-module-docstring-",
"--ignore=missing-function-docstring",
"--max-line-length=120",
},
pyflakes = { enabled = false },
pycodestyle = { enabled = false },
-- Formatter
black = {
enabled = true,
line_length = 120,
},
autopep8 = {
enabled = false,
args = {
"--max-line-length=120",
"--experimental"
}
},
yapf = { enabled = false },
-- Refactoring
pylsp_rope = { enabled = true },
}
}
}
}
end
},
}
)
2 changes: 2 additions & 0 deletions nvim/after/plugin/nightfox.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vim.cmd([[colorscheme terafox]])
require('lualine').setup({})
6 changes: 6 additions & 0 deletions nvim/after/plugin/telescope.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
vim.keymap.set('n', '<leader>pr', builtin.lsp_references, {})
vim.keymap.set('n', '<leader>ps', function()
builtin.grep_string({ search = vim.fn.input("Grep > ")});
end)
22 changes: 22 additions & 0 deletions nvim/after/plugin/treesitter.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "python", "javascript", "markdown", "json", "html", "bash" },

-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,

-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,


highlight = {
enable = true,

-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = true,
},
}
1 change: 1 addition & 0 deletions nvim/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require("bertaux")
22 changes: 22 additions & 0 deletions nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "df58ee1664cfda71479cd2bbd56114f56599eba6" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"gitsigns.nvim": { "branch": "main", "commit": "5fc573f2d2a49aec74dd6dc977e8b137429d1897" },
"harpoon": { "branch": "master", "commit": "c1aebbad9e3d13f20bedb8f2ce8b3a94e39e424a" },
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
"lexima.vim": { "branch": "master", "commit": "b1e1b1bde07c1efc97288c98c5912eaa644ee6e1" },
"lsp-zero.nvim": { "branch": "v3.x", "commit": "8a9ee4e11a3e23101d1d1d11aaac3159ad925cc9" },
"lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "a5476087db0a20c05bd1163e1cd4a29b795e73a7" },
"mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" },
"nightfox.nvim": { "branch": "main", "commit": "eb82712f86319272f4b7b9dbb4ec6df650e6987f" },
"nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" },
"nvim-lspconfig": { "branch": "master", "commit": "553c4e0e667167640c5398573f6f3a488ff8047a" },
"nvim-treesitter": { "branch": "master", "commit": "9d91101f71cc64cdef923a3b14130db82985bac6" },
"nvim-web-devicons": { "branch": "master", "commit": "cdbcca210cf3655aa9b31ebf2422763ecd85ee5c" },
"plenary.nvim": { "branch": "master", "commit": "366b0837486f60ae0e7550c15de8ff66d057c4cd" },
"telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
"vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }
}
3 changes: 3 additions & 0 deletions nvim/lua/bertaux/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require("bertaux.lazy")
require("bertaux.remap")
require("bertaux.set")
47 changes: 47 additions & 0 deletions nvim/lua/bertaux/lazy.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)

vim.g.mapleader = " "

local plugins = {
{
"EdenEast/nightfox.nvim",
lazy = false,
priority = 1000,
},
{
'nvim-telescope/telescope.nvim',
tag = '0.1.4',
dependencies = { 'nvim-lua/plenary.nvim' }
},
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
'theprimeagen/harpoon',
'tpope/vim-fugitive',
'tpope/vim-surround',
'numToStr/Comment.nvim',
'lewis6991/gitsigns.nvim',
'cohama/lexima.vim',
{ 'VonHeikemen/lsp-zero.nvim', branch = 'v3.x' },
'neovim/nvim-lspconfig',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/nvim-cmp',
'L3MON4D3/LuaSnip',
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons', opt = true }
},
}

require("lazy").setup(plugins, opt)
35 changes: 35 additions & 0 deletions nvim/lua/bertaux/remap.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
vim.g.mapleader = " "
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex) -- Use <leader>pv to open the file tree (pv = preview)
vim.keymap.set("n", "<leader>tt", function()
vim.cmd("tabnew")
vim.cmd("terminal")
end)

-- Use J and K to move whole blocks of highlighted code in visual mode
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")

-- Keeps the cursor in the middle of the screen when jumping half pages
vim.keymap.set("n", "<C-d>", "<C-d>zz")
vim.keymap.set("n", "<C-u>", "<C-u>zz")

-- Keeps the cursor in the middle when searching terms
vim.keymap.set("n", "n", "nzzzv")
vim.keymap.set("n", "N", "Nzzzv")

-- Use <leader>p to paste without putting the replaced text in the buffer
vim.keymap.set("x", "<leader>p", [["_dP]])

-- Use <leader>y to yank to the system's clipboard
vim.keymap.set({"n", "v"}, "<leader>y", [["+y]])
vim.keymap.set("n", "<leader>Y", [["+Y]])

-- Use <leader>d to delete to void register
vim.keymap.set({"n", "v"}, "<leader>d", [["_d]])

-- Tab management remaps
vim.keymap.set({"n", "t"}, "<C-t>", vim.cmd.tabnew) -- Open new tab
vim.keymap.set({"n", "t"}, "<C-x>", vim.cmd.tabc) -- Close current tab
vim.keymap.set({"n", "t"}, "<C-l>l", vim.cmd.tabr) -- Move to tab right
vim.keymap.set({"n", "t"}, "<C-l>h", vim.cmd.tabl) -- Move to tab left
vim.keymap.set({"n", "t"}, "<C-n>", vim.cmd.tabn) -- Move to next tab
30 changes: 30 additions & 0 deletions nvim/lua/bertaux/set.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-- Line numbers and relative line numbersvim.opt.nu = true
vim.opt.relativenumber = true

-- Tabulation
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true

-- Smart indenting
vim.opt.smartindent = true

-- No line wrap
vim.opt.wrap = false

-- No highlight search and incremental search
vim.opt.hlsearch = false
vim.opt.incsearch = true

vim.opt.termguicolors = true

vim.opt.colorcolumn = "100"

vim.opt.scrolloff = 8

-- Show open tabs (=1 to only show it when more than one tab open)
vim.opt.showtabline=2

-- Decrease time required to enter a command
vim.opt.timeoutlen=500
37 changes: 37 additions & 0 deletions tmux/tmux.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
set -g mouse on

# Sets the escape time
set -g escape-time 100

# set scrollback history to 10000 (10k)
set -g history-limit 10000

# Set the prefix to control + space
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix

# reload ~/.tmux.conf using PREFIX r
bind r source-file ~/.dotfiles/tmux/tmux.conf \; display "Tmux config reloaded"

# vi keys to navigate panes
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R

# colors, clock, and stuff
set -g default-terminal "tmux-256color"
set -ga terminal-features ",xterm-256color:RGB"
set -g clock-mode-style 24

# Rename window to current directory
#set-option -g status-interval 1
#set-option -g automatic-rename on
#set-option -g automatic-rename-format '#{b:pane_current_path}'
# set-option -g automatic-rename-format "#{?#{==:#{pane_current_command},zsh},#{b:pane_current_path},#{pane_current_command}}"

set-option -g focus-events on

source-file /Users/clement/.dotfiles/tmux/tmux.terafox.theme

23 changes: 23 additions & 0 deletions tmux/tmux.terafox.theme
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Nightfox colors for Tmux
# Style: terafox
# Upstream: https://github.com/edeneast/nightfox.nvim/raw/main/extra/terafox/nightfox_tmux.tmux
set -g mode-style "fg=#0f1c1e,bg=#cbd9d8"
set -g message-style "fg=#0f1c1e,bg=#cbd9d8"
set -g message-command-style "fg=#0f1c1e,bg=#cbd9d8"
set -g pane-border-style "fg=#cbd9d8"
set -g pane-active-border-style "fg=#5a93aa"
set -g status "on"
set -g status-justify "left"
set -g status-style "fg=#cbd9d8,bg=#0f1c1e"
set -g status-left-length "100"
set -g status-right-length "100"
set -g status-left-style NONE
set -g status-right-style NONE
set -g status-left "#[fg=#0f1c1e,bg=#5a93aa,bold] #S #[fg=#5a93aa,bg=#0f1c1e,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#0f1c1e,bg=#0f1c1e,nobold,nounderscore,noitalics]#[fg=#5a93aa,bg=#0f1c1e] #{prefix_highlight} #[fg=#cbd9d8,bg=#0f1c1e,nobold,nounderscore,noitalics]#[fg=#0f1c1e,bg=#cbd9d8] %Y-%m-%d  %I:%M %p #[fg=#5a93aa,bg=#cbd9d8,nobold,nounderscore,noitalics]#[fg=#0f1c1e,bg=#5a93aa,bold] #h "
setw -g window-status-activity-style "underscore,fg=#587b7b,bg=#0f1c1e"
setw -g window-status-separator ""
setw -g window-status-style "NONE,fg=#587b7b,bg=#0f1c1e"
setw -g window-status-format "#[fg=#0f1c1e,bg=#0f1c1e,nobold,nounderscore,noitalics]#[default] #I  #W #F #[fg=#0f1c1e,bg=#0f1c1e,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#0f1c1e,bg=#cbd9d8,nobold,nounderscore,noitalics]#[fg=#0f1c1e,bg=#cbd9d8,bold] #I  #W #F #[fg=#cbd9d8,bg=#0f1c1e,nobold,nounderscore,noitalics]"
Loading

0 comments on commit f1cccd1

Please sign in to comment.