From d4ca9abf844a3fb9cfb55e2c0ba06a0d28a0a1dd Mon Sep 17 00:00:00 2001 From: Kevin Cotugno Date: Wed, 22 Feb 2017 20:49:21 -0800 Subject: [PATCH] Initial --- .gitignore | 1 + README.md | 3 ++ config/emacs.d/init.el | 97 ++++++++++++++++++++++++++++++++++++++ config/nvim/init.vim | 103 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 204 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 config/emacs.d/init.el create mode 100644 config/nvim/init.vim diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b25c15b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/README.md b/README.md new file mode 100644 index 0000000..ee614ce --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# dotfile + +Just my personal configuration files \ No newline at end of file diff --git a/config/emacs.d/init.el b/config/emacs.d/init.el new file mode 100644 index 0000000..6adc32c --- /dev/null +++ b/config/emacs.d/init.el @@ -0,0 +1,97 @@ +;; init.el +;; +;; Emacs Configuration +;; +;; Author: Kevin Cotugno git@kevincotugno.com +;; Date: 2/22/17 + +;; Package +(require 'package) +(package-initialize) + +(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/")) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) +(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/")) + +(unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) + +(eval-when-compile + (require 'use-package)) + +(setq use-package-always-ensure t) + +;; Display +(set-default-font "Source Code Pro-12") +(line-number-mode t) +(global-linum-mode t) +(when 'display-graphic-p + (global-hl-line-mode)) + +(menu-bar-mode -1) +(tool-bar-mode -1) +(scroll-bar-mode -1) + +(when 'display-graphic-p (lambda () + (global-hl-line-mode t))) +;; End display + +;; Auto generated config +(setq custom-file (expand-file-name "auto.el" user-emacs-directory)) +(load custom-file 'noerror) +;; End auto generated config + +;; Text Formatting +(setq-default indent-tabs-mode nil) +(setq-default tab-width 2) +(setq-default c-default-style "linux" + c-basic-offset 8 + tab-width 8) +;; End text Formatting + +;; Plugins + +;; Themes +(use-package dash) + +(-each + (-map + (lambda (item) + (format "~/.emacs.d/themes/%s" item)) + (-remove + (lambda (item) (or (string= item ".") (string= item ".."))) + (directory-files ".emacs.d/themes/"))) + (lambda (item) + (add-to-list 'custom-theme-load-path item))) + +(load-theme 'solarized t) +(set-frame-parameter nil 'background-mode 'dark) +(enable-theme 'solarized) + +;; End themes + +(use-package evil + :config + (evil-mode t) + (global-set-key (kbd "C-c C-c") 'evil-force-normal-state)) + + +(use-package evil-leader + :config + (global-evil-leader-mode) + (evil-leader/set-leader "\\")) + +(use-package evil-org) + +(use-package powerline + :config + (powerline-default-theme)) + +(use-package org-bullets + :config + (add-hook 'org-mode-hook (lambda () + (org-bullets-mode t)))) +(use-package magit) + +;; End Plugins diff --git a/config/nvim/init.vim b/config/nvim/init.vim new file mode 100644 index 0000000..c4db95b --- /dev/null +++ b/config/nvim/init.vim @@ -0,0 +1,103 @@ +" vim-plug---START +call plug#begin('~/.config/nvim/plugged') + +" Plugins +Plug 'airblade/vim-gitgutter' +Plug 'kien/ctrlp.vim' +Plug 'majutsushi/tagbar' +Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } +Plug 'scrooloose/syntastic' +Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } +Plug 'tpope/vim-fugitive' +Plug 'tpope/vim-rails' +Plug 'tpope/vim-surround' +Plug 'vim-syntastic/syntastic' +Plug 'altercation/vim-colors-solarized' + +call plug#end() + +" vim-plug---END + +set number +syntax enable +set background=dark +colorscheme solarized +set nowrap +filetype plugin indent on + +set list +set listchars=tab:»»,trail:~ + +set tabstop=2 +set shiftwidth=2 +set expandtab + +autocmd BufRead,BufNewFile *.h,*.c,*.cpp, set tabstop=8 shiftwidth=8 expandtab +autocmd BufRead,BufNewFile *.cs,*.java set tabstop=4 shiftwidth=4 expandtab + +function TrimTrailingInvisibles() + let view = winsaveview() + %s/\s\+$//e + call winrestview(view) +endfunction + +function TrimTrailingLines() + let view = winsaveview() + %s/\n\+\%$//e + call winrestview(view) +endfunction + +augroup maximus + +autocmd BufWrite * call TrimTrailingInvisibles() | call TrimTrailingLines() +autocmd BufLeave * if &buftype == '' && !&readonly && &modifiable && &modified && expand("%:t") != "" | call TrimTrailingInvisibles() | call TrimTrailingLines() | w | SyntasticCheck | GitGutter | endif + +augroup END + + +set statusline=%f +set statusline+=\ %y +set statusline+=[%{&ff}] +set statusline+=%r +set statusline+=%h +set statusline+=%{ModifiedSym()} +set statusline+=%= +set statusline+=%{SyntasticStatuslineFlag()} +set statusline+=%= +set statusline+=%{AddGitGutterToStatusline()} +set statusline+=\ [%c:%l/%L:%p%%] + +function ModifiedSym() + if &modified + return "[\u270f]" + else + return "" + end +endfunction + +function AddGitGutterToStatusline() + if &buftype == '' && exists("b:gitgutter_summary") + return join(["[Git:", join(b:gitgutter_summary, ","), "]"], "") + else + return "" + endif +endfunction + +" Shortcuts +nmap :NERDTreeToggle +nmap . :TagbarToggle + +" Plugin configuration +" deoplete +let g:deoplete#enable_at_startup = 1 +let g:deoplete#enable_ignore_case = 1 + +" Syntastic +let g:syntastic_stl_format = "[Err: first:%fe total:%e] [Warn: first:%fw total:%w]" +let g:syntastic_check_on_open = 1 +let g:syntastic_check_on_wq = 1 +let g:syntastic_enable_signs = 1 +let g:syntastic_aggregate_errors = 1 +let g:syntastic_ruby_checkers = ['rubocop', 'mri'] +let g:syntastic_error_symbol = "\u2717" +let g:syntastic_warning_symbol = "\uFE0E" \ No newline at end of file