Guest User

Untitled

a guest
Sep 22nd, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 23.34 KB | None | 0 0
  1. ;; -*- mode: emacs-lisp -*-
  2. ;; This file is loaded by Spacemacs at startup.
  3. ;; It must be stored in your home directory.
  4.  
  5. (defun dotspacemacs/layers ()
  6.  
  7.   "Configuration Layers declaration.
  8. You should not put any user code in this function besides modifying the variable
  9. values."
  10.   (setq-default
  11.    ;; Base distribution to use. This is a layer contained in the directory
  12.    ;; `+distribution'. For now available distributions are `spacemacs-base'
  13.    ;; or `spacemacs'. (default 'spacemacs)
  14.    dotspacemacs-distribution 'spacemacs
  15.    ;; Lazy installation of layers (i.e. layers are installed only when a file
  16.    ;; with a supported type is opened). Possible values are `all', `unused'
  17.    ;; and `nil'. `unused' will lazy install only unused layers (i.e. layers
  18.    ;; not listed in variable `dotspacemacs-configuration-layers'), `all' will
  19.    ;; lazy install any layer that support lazy installation even the layers
  20.    ;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy
  21.    ;; installation feature and you have to explicitly list a layer in the
  22.    ;; variable `dotspacemacs-configuration-layers' to install it.
  23.    ;; (default 'unused)
  24.    dotspacemacs-enable-lazy-installation 'unused
  25.    ;; If non-nil then Spacemacs will ask for confirmation before installing
  26.    ;; a layer lazily. (default t)
  27.    dotspacemacs-ask-for-lazy-installation t
  28.    ;; If non-nil layers with lazy install support are lazy installed.
  29.    ;; List of additional paths where to look for configuration layers.
  30.    ;; Paths must have a trailing slash (i.e mmm-mode-0.. `~/.mycontribs/')
  31.    dotspacemacs-configuration-layer-path '()
  32.    ;; List of configuration layers to load.
  33.    dotspacemacs-configuration-layers
  34.    '(
  35.      octave
  36.      rust
  37.      csv
  38.      markdown
  39.      yaml
  40.      ;javascript
  41.      ;csv
  42.      (python :variables
  43.              python-indent 8
  44.              python-indent-offset 4
  45.              indent-tabs-mode t
  46.              tab-width 4
  47.              )
  48.      lua
  49.      ;(javascriptcolors :variables colors-enable-nyan-cat-ptrogress-bar t colors-enable-rainbow-identifiers t)
  50.  
  51.      ;; ----------------------------------------------------------------
  52.      ;; Example of useful layers you may want to use right away.
  53.      ;; Uncomment some layer names and press <SPC f e R> (Vim style) or
  54.      ;; <M-m f e R> (Emacs style) to install them.
  55.      ;; ----------------------------------------------------------------
  56.      helm
  57.      auto-completion
  58.      better-defaults
  59.      emacs-lisp
  60.      git
  61.      ;markdown
  62.      org
  63.      (shell :variables
  64.              shell-default-height 30
  65.              shell-default-position 'bottom
  66.              )
  67.       spell-checking
  68.       syntax-checking
  69.       version-control
  70.  
  71.       ;(colors :variables colors-enable-nyan-cat-progress-bar t colors-enable-rainbow-identifiers t)
  72.       )
  73.    ;; List of additional packages that will be installed without being
  74.    ;; wrapped in a layer. If you need some configuration for these
  75.    ;; packages, then consider creating a layer. You can also put the
  76.    ;; configuration in `dotspacemacs/user-config'.
  77.    dotspacemacs-additional-packages '(
  78.                                       multiple-cursors
  79.                                       arduino-mode
  80.                                       org-autolist
  81.                                       yasnippet
  82.                                       drag-stuff
  83.                                       nodemcu-mode
  84.                                       ;rtags
  85.                                       ;company-rtags
  86.                                       ;helm-rtags
  87.                                       )
  88.    ;; A list of packages that cannot be updated.
  89.    dotspacemacs-frozen-packages '()
  90.    ;; A list of packages that will not be installed and loaded.
  91.    dotspacemacs-excluded-packages '()
  92.    ;; Defines the behaviour of Spacemacs when installing packages.
  93.    ;; Possible values are `used-only', `used-but-keep-unused' and `all'.
  94.    ;; `used-only' installs only explicitly used packages and uninstall any
  95.    ;; unused packages as well as their unused dependencies.
  96.    ;; `used-but-keep-unused' installs only the used packages but won't uninstall
  97.    ;; them if they become unused. `all' installs *all* packages supported by
  98.    ;; Spacemacs and never uninstall them. (default is `used-only')
  99.    dotspacemacs-install-packages 'used-but-keep-unused))
  100.  
  101.  
  102.  
  103. (defun dotspacemacs/init ()
  104.   "Initialization function.
  105. This function is called at the very startup of Spacemacs initialization
  106. before layers configuration.
  107. You should not put any user code in there besides modifying the variable
  108. values."
  109.   ;; This setq-default sexp is an exhaustive list of all the supported
  110.   ;; spacemacs settings.
  111.  
  112.   (setq-default
  113.    ;; If non nil ELPA repositories are contacted via HTTPS whenever it's
  114.    ;; possible. Set it to nil if you have no way to use HTTPS in your
  115.    ;; environment, otherwise it is strongly recommended to let it set to t.
  116.    ;; This variable has no effect if Emacs is launched with the parameter
  117.    ;; `--insecure' which forces the value of this variable to nil.
  118.    ;; (default t)
  119.    dotspacemacs-elpa-https nil
  120.    ;; Maximum allowed time in seconds to contact an ELPA repository.
  121.    dotspacemacs-elpa-timeout 5
  122.    ;; If non nil then spacemacs will check for updates at startup
  123.    ;; when the current branch is not `develop'. Note that checking for
  124.    ;; new versions works via git commands, thus it calls GitHub services
  125.    ;; whenever you start Emacs. (default nil)
  126.    dotspacemacs-check-for-update nil
  127.    ;; If non-nil, a form that evaluates to a package directory. For example, to
  128.    ;; use different package directories for different Emacs versions, set this
  129.    ;; to `emacs-version'.
  130.    dotspacemacs-elpa-subdirectory nil
  131.    ;; One of `vim', `emacs' or `hybrid'.
  132.    ;; `hybrid' is like `vim' except that `insert state' is replaced by the
  133.    ;; `hybrid state' with `emacs' key bindings. The value can also be a list
  134.    ;; with `:variables' keyword (similar to layers). Check the editing styles
  135.    ;; section of the documentation for details on available variables.
  136.    ;; (default 'vim)
  137.    dotspacemacs-editing-style 'emacs
  138.    ;; If non nil output loading progress in `*Messages*' buffer. (default nil)
  139.    dotspacemacs-verbose-loading nil
  140.    ;; Specify the startup banner. Default value is `official', it displays
  141.    ;; the official spacemacs logo. An integer value is the index of text
  142.    ;; banner, `random' chooses a random text banner in `core/banners'
  143.    ;; directory. A string value must be a path to an image format supported
  144.    ;; by your Emacs build.
  145.    ;; If the value is nil then no banner is displayed. (default 'official)
  146.    dotspacemacs-startup-banner 'random
  147.    ;; List of items to show in startup buffer or an association list of
  148.    ;; the form `(list-type . list-size)`. If nil then it is disabled.
  149.    ;; Possible values for list-type are:
  150.    ;; `recents' `bookmarks' `projects' `agenda' `todos'."
  151.    ;; List sizes may be nil, in which case
  152.    ;; `spacemacs-buffer-startup-lists-length' takes effect.
  153.    dotspacemacs-startup-lists '((recents . 8)
  154.                                 (projects . 8))
  155.    ;; True if the home buffer should respond to resize events.
  156.    dotspacemacs-startup-buffer-responsive t
  157.    ;; Default major mode of the scratch buffer (default `text-mode')
  158.    dotspacemacs-scratch-mode 'text-mode
  159.    ;; List of themes, the first of the list is loaded when spacemacs starts.
  160.    ;; Press <SPC> T n to cycle to the next theme in the list (works great
  161.    ;; with 2 themes variants, one dark and one light)
  162.    dotspacemacs-themes '(spacemacs-dark
  163.                          spacemacs-light)
  164.    ;; If non nil the cursor color matches the state color in GUI Emacs.
  165.    dotspacemacs-colorize-cursor-according-to-state t
  166.    ;; Default font, or prioritized list of fonts. `powerline-scale' allows to
  167.    ;; quickly tweak the mode-line size to make separators look not too crappy.
  168.    dotspacemacs-default-font '( "Fira Mono"
  169.                                 :size 15
  170.                                 :weight normal
  171.                                 :width normal
  172.                                 :powerline-scale 1.1)
  173.    ;; The leader key
  174.    dotspacemacs-leader-key "SPC"
  175.    ;; The key used for Emacs commands (M-x) (after pressing on the leader key).
  176.    ;; (default "SPC")
  177.    dotspacemacs-emacs-command-key "SPC"
  178.    ;; The key used for Vim Ex commands (default ":")
  179.    dotspacemacs-ex-command-key ":"
  180.    ;; The leader key accessible in `emacs state' and `insert state'
  181.    ;; (default "M-m")
  182.    dotspacemacs-emacs-leader-key "M-m"
  183.    ;; Major mode leader key is a shortcut key which is the equivalent of
  184.    ;; pressing `<leader> m`. Set it to `nil` to disable it. (default ",")
  185.    dotspacemacs-major-mode-leader-key ","
  186.    ;; Major mode leader key accessible in `emacs state' and `insert state'.
  187.    ;; (default "C-M-m")
  188.    dotspacemacs-major-mode-emacs-leader-key "C-M-m"
  189.    ;; These variables control whether separate commands are bound in the GUI to
  190.    ;; the key pairs C-i, TAB and C-m, RET.
  191.    ;; Setting it to a non-nil value, allows for separate commands under <C-i>
  192.    ;; and TAB or <C-m> and RET.
  193.    ;; In the terminal, these pairs are generally indistinguishable, so this only
  194.    ;; works in the GUI. (default nil)
  195.    dotspacemacs-distinguish-gui-tab nil
  196.    ;; If non nil `Y' is remapped to `y$' in Evil states. (default nil)
  197.    dotspacemacs-remap-Y-to-y$ nil
  198.    ;; If non-nil, the shift mappings `<' and `>' retain visual state if used
  199.    ;; there. (default t)
  200.    dotspacemacs-retain-visual-state-on-shift t
  201.    ;; If non-nil, J and K move lines up and down when in visual mode.
  202.    ;; (default nil)
  203.    dotspacemacs-visual-line-move-text nil
  204.    ;; If non nil, inverse the meaning of `g' in `:substitute' Evil ex-command.
  205.    ;; (default nil)
  206.    dotspacemacs-ex-substitute-global nil
  207.    ;; Name of the default layout (default "Default")
  208.    dotspacemacs-default-layout-name "Default"
  209.    ;; If non nil the default layout name is displayed in the mode-line.
  210.    ;; (default nil)
  211.    dotspacemacs-display-default-layout nil
  212.    ;; If non nil then the last auto saved layouts are resume automatically upon
  213.    ;; start. (default nil)
  214.    dotspacemacs-auto-resume-layouts nil
  215.    ;; Size (in MB) above which spacemacs will prompt to open the large file
  216.    ;; literally to avoid performance issues. Opening a file literally means that
  217.    ;; no major mode or minor modes are active. (default is 1)
  218.    dotspacemacs-large-file-size 1
  219.    ;; Location where to auto-save files. Possible values are `original' to
  220.    ;; auto-save the file in-place, `cache' to auto-save the file to another
  221.    ;; file stored in the cache directory and `nil' to disable auto-saving.
  222.    ;; (default 'cache)
  223.    dotspacemacs-auto-save-file-location 'cache
  224.    ;; Maximum number of rollback slots to keep in the cache. (default 5)
  225.    dotspacemacs-max-rollback-slots 5
  226.    ;; If non nil, `helm' will try to minimize the space it uses. (default nil)
  227.    dotspacemacs-helm-resize nil
  228.    ;; if non nil, the helm header is hidden when there is only one source.
  229.    ;; (default nil)
  230.    dotspacemacs-helm-no-header nil
  231.    ;; define the position to display `helm', options are `bottom', `top',
  232.    ;; `left', or `right'. (default 'bottom)
  233.    dotspacemacs-helm-position 'bottom
  234.    ;; Controls fuzzy matching in helm. If set to `always', force fuzzy matching
  235.    ;; in all non-asynchronous sources. If set to `source', preserve individual
  236.    ;; source settings. Else, disable fuzzy matching in all sources.
  237.    ;; (default 'always)
  238.    dotspacemacs-helm-use-fuzzy 'always
  239.    ;; If non nil the paste micro-state is enabled. When enabled pressing `p`
  240.    ;; several times cycle between the kill ring content. (default nil)
  241.    dotspacemacs-enable-paste-transient-state nil
  242.    ;; Which-key delay in seconds. The which-key buffer is the popup listing
  243.    ;; the commands bound to the current keystroke sequence. (default 0.4)
  244.    dotspacemacs-which-key-delay 0.5
  245.    ;; Which-key frame position. Possible values are `right', `bottom' and
  246.    ;; `right-then-bottom'. right-then-bottom tries to display the frame to the
  247.    ;; right; if there is insufficient space it displays it at the bottom.
  248.    ;; (default 'bottom)
  249.    dotspacemacs-which-key-position 'bottom
  250.    ;; If non nil a progress bar is displayed when spacemacs is loading. This
  251.    ;; may increase the boot time on some systems and emacs builds, set it to
  252.    ;; nil to boost the loading time. (default t)
  253.    dotspacemacs-loading-progress-bar t
  254.    ;; If non nil the frame is fullscreen when Emacs starts up. (default nil)
  255.    ;; (Emacs 24.4+ only)
  256.    dotspacemacs-fullscreen-at-startup nil
  257.    ;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen.
  258.    ;; Use to disable fullscreen animations in OSX. (default nil)
  259.    dotspacemacs-fullscreen-use-non-native nil
  260.    ;; If non nil the frame is maximized when Emacs starts up.
  261.    ;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.
  262.    ;; (default nil) (Emacs 24.4+ only)
  263.    dotspacemacs-maximized-at-startup nil
  264.    ;; A value from the range (0..100), in increasing opacity, which describes
  265.    ;; the transparency level of a frame when it's active or selected.
  266.    ;; Transparency can be toggled through `toggle-transparency'. (default 90)
  267.    dotspacemacs-active-transparency 90
  268.    ;; A value from the range (0..100), in increasing opacity, which describes
  269.    ;; the transparency level of a frame when it's inactive or deselected.
  270.    ;; Transparency can be toggled through `toggle-transparency'. (default 90)
  271.    dotspacemacs-inactive-transparency 70
  272.    ;; If non nil show the titles of transient states. (default t)
  273.    dotspacemacs-show-transient-state-title t
  274.    ;; If non nil show the color guide hint for transient state keys. (default t)
  275.    dotspacemacs-show-transient-state-color-guide t
  276.    ;; If non nil unicode symbols are displayed in the mode line. (default t)
  277.    dotspacemacs-mode-line-unicode-symbols t
  278.    ;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth
  279.    ;; scrolling overrides the default behavior of Emacs which recenters point
  280.    ;; when it reaches the top or bottom of the screen. (default t)
  281.    dotspacemacs-smooth-scrolling t
  282.    ;; Control line numbers activation.
  283.    ;; If set to `t' or `relative' line numbers are turned on in all `prog-mode' and
  284.    ;; `text-mode' derivatives. If set to `relative', line numbers are relative.
  285.    ;; This variable can also be set to a property list for finer control:
  286.    ;; '(:relative nil
  287.    ;;   :disabled-for-modes dired-mode
  288.    ;;                       doc-view-mode
  289.    ;;                       markdown-mode
  290.    ;;                       org-mode
  291.    ;;                       pdf-view-mode
  292.    ;;                       text-mode
  293.    ;;   :size-limit-kb 1000)
  294.    ;; (default nil)
  295.    dotspacemacs-line-numbers t
  296.    ;; Code folding method. Possible values are `evil' and `origami'.
  297.    ;; (default 'evil)
  298.    dotspacemacs-folding-method 'evil
  299.    ;; If non-nil smartparens-strict-mode will be enabled in programming modes.
  300.    ;; (default nil)
  301.    dotspacemacs-smartparens-strict-mode nil
  302.    ;; If non-nil pressing the closing parenthesis `)' key in insert mode passes
  303.    ;; over any automatically added closing parenthesis, bracket, quote, etc…
  304.    ;; This can be temporary disabled by pressing `C-q' before `)'. (default nil)
  305.    dotspacemacs-smart-closing-parenthesis nil
  306.    ;; Select a scope to highlight delimiters. Possible values are `any',
  307.    ;; `current', `all' or `nil'. Default is `all' (highlight any scope and
  308.    ;; emphasis the current one). (default 'all)
  309.    dotspacemacs-highlight-delimiters 'all
  310.    ;; If non nil, advise quit functions to keep server open when quitting.
  311.    ;; (default nil)
  312.    dotspacemacs-persistent-server nil
  313.    ;; List of search tool executable names. Spacemacs uses the first installed
  314.    ;; tool of the list. Supported tools are `ag', `pt', `ack' and `grep'.
  315.    ;; (default '("ag" "pt" "ack" "grep"))
  316.    dotspacemacs-search-tools '("ag" "pt" "ack" "grep")
  317.    ;; The default package repository used if no explicit repository has been
  318.    ;; specified with an installed package.
  319.    ;; Not used for now. (default nil)
  320.    dotspacemacs-default-package-repository nil
  321.    ;; Delete whitespace while saving buffer. Possible values are `all'
  322.    ;; to aggressively delete empty line and long sequences of whitespace,
  323.    ;; `trailing' to delete only the whitespace at end of lines, `changed'to
  324.    ;; delete only whitespace for changed lines or `nil' to disable cleanup.
  325.    ;; (default nil)
  326.    dotspacemacs-whitespace-cleanup 'all
  327.  
  328.    ))
  329.  
  330. (defun dotspacemacs/user-init ()
  331.   "Initialization function for user code.
  332. It is called immediately after `dotspacemacs/init', before layer configuration
  333. executes.
  334. This function is mostly useful for variables that need to be set
  335. before packages are loaded. If you are unsure, you should try in setting them in
  336. `dotspacemacs/user-config' first."
  337.  
  338.   (setq drag-stuff-global-mode t)
  339.   (setq exec-path-from-shell-check-startup-files nil)
  340.                                         ;(setq rtags-use-helm t)
  341.                                         ; (setq rtags-completions-enabled t)
  342.   (setq org-image-actual-width 400
  343.         org-startup-with-inline-images t
  344.         org-directory "~/mega-doc/org/"
  345.         org-default-notes-file (concat org-directory "organizer.org")
  346.         org-startup-folded t)
  347.  
  348.   )
  349.  
  350. (defun dotspacemacs/user-config ()
  351.   "Configuration function for user code.
  352. This function is called at the very end of Spacemacs initialization after
  353. layers configuration.
  354.  
  355. This is the place where most of your configurations should be done. Unless it is
  356. explicitly specified that a variable should be set before a package is loaded,
  357. you should place your code here."
  358.  
  359.   (spacemacs/toggle-fill-column-indicator-on)
  360.  
  361.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  362.   ;; Personal Info
  363.  
  364.   (setq user-full-name "Lucas Martins Mendes")
  365.   (setq user-work-email "lucas.mendes@macnicadhw.com.br")
  366.   (setq user-email "lucas.martinsmendes@gmail.com")
  367.  
  368.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  369.   ;; GNU make
  370.   (add-hook  'makefile-mode (lambda () (setq tab-width 4)))
  371.  
  372.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  373.   ;; Yasnippet
  374.  
  375.   (defun buffer-mode (&optional buffer-or-name)
  376.     "Returns the major mode associated with a buffer.
  377.     If buffer-or-name is nil return current buffer's mode. used by yasnippet"
  378.     (buffer-local-value 'major-mode
  379.                         (if buffer-or-name (get-buffer buffer-or-name) (current-buffer))))
  380.  
  381.   (defun yas/org-very-safe-expand ()
  382.     (let ((yas/fallback-behavior 'return-nil)) (yas-expand)))
  383.  
  384.   (setq yas-snippet-dirs (list "~/Documents/mega-doc/config-files/emacs/snippets/"))
  385.   (setq yas-visit-from-menu t)
  386.  
  387.   (global-set-key (kbd "C-c e") 'yas-expand)
  388.  
  389.   (yas-global-mode t)
  390.  
  391.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  392.   ;; Python mode setup
  393.   (add-hook 'python-mode-hook
  394.             (lambda ()
  395.               (setq
  396.                python-indent 4
  397.                python-indent-offset 4
  398.                indent-tabs-mode t
  399.                tab-width 4)))
  400.  
  401.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  402.   ;; Org mode settings
  403.   (defun org-sort-headings-todo-prio ()
  404.     "sort org headings first by priority then by todo order"
  405.     (interactive)
  406.     (org-sort-entries t ?p )
  407.     (outline-up-heading)
  408.     (org-sort-entries t ?o ))
  409.  
  410.   (setq org-image-actual-width 400
  411.         org-startup-with-inline-images t
  412.         org-directory "~/mega-doc/org/"
  413.         org-default-notes-file (concat org-directory "organizer.org")
  414.         org-startup-folded t)
  415.  
  416.   (add-hook 'org-mode-hook
  417.             (lambda ()
  418.               (yas-minor-mode)
  419.               (make-variable-buffer-local 'yas/trigger-key)
  420.               (setq yas/trigger-key [tab])
  421.               (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
  422.               (define-key yas/keymap [tab] 'yas/next-field)
  423.               (flycheck-mode 1)
  424.               (flyspell-mode-on)
  425.               (org-autolist-mode)
  426.               (org-bullets-mode)
  427.               (local-set-key (kbd "C-c C-x s") (org-sort-headings-todo-prio))))
  428.  
  429.   (global-set-key (kbd "C-c o") (lambda () (interactive) (find-file org-default-notes-file)))
  430.   (global-set-key [c-x c-c c-r] 'org-preview-latex-default-process)
  431.   (global-set-key (kbd "C-c c") 'org-capture)
  432.  
  433.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  434.   ;; RTAGS
  435.   ;(eval-after-load 'company
  436.   ;  '(add-to-list
  437.   ;    'company-backends 'company-rtags))
  438.   ;(setq rtags-autostart-diagnostics t)
  439.   ;(rtags-enable-standard-keybindings)
  440.  
  441.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  442.   ;; Company mode
  443.   ;(push '(company-semantic :with company-yasnippet) company-backends)
  444.  
  445.   (global-company-mode)
  446.  
  447.   ;; (define-key company-active-map [?\t] 'company-yasnippet-or-completion)
  448.   ;;
  449.   ;; (defun company-yasnippet-or-completion ()
  450.   ;;   (interactive)
  451.   ;;   (if (yas/expansion-at-point)
  452.   ;;       (progn (company-abort)
  453.   ;;              (yas-expand))
  454.   ;;     (company-complete-common)))
  455.   ;;
  456.   ;; (defun yas/expansion-at-point ()
  457.   ;;   "Tested with v0.6.1. Extracted from `yas-expand'"
  458.   ;;   (first (yas/current-key)))
  459.  
  460.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  461.   ;; Flyspell
  462.  
  463.   (flyspell-mode-off)
  464.  
  465.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  466.   ;; C and C++
  467.  
  468.   (defun c-cpp-commom-setup ()
  469.     "commom paramters set between c and c++ modes"
  470.     (flycheck-mode t)
  471.     (flyspell-mode-off)
  472.     (spacemacs/toggle-fill-column-indicator-on)
  473.     (setq c-syntactic-indentation t)
  474.     (setq c-default-style "linux")
  475.     (setq c-basic-offset 4)
  476.     (auto-fill-mode) ;enable auto fill mode
  477.     (add-hook 'c-special-indent-hook
  478.               (lambda ()
  479.                 (yas-expand) (c-guess-basic-syntax))))
  480.  
  481.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  482.   ;; c++-mode
  483.   (add-hook 'c++-mode-hook (lambda ()
  484.                              (c-cpp-commom-setup)))
  485.  
  486.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  487.   ;; c-mode
  488.   (add-hook 'c-mode-hook (lambda()
  489.                            ;(add-to-list 'company-backends 'company-yasnippet)
  490.                            (c-cpp-commom-setup)))
  491.  
  492.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  493.   ;; Multi-cursor
  494.  
  495.   ;;Multi cursor
  496.   (global-set-key (kbd "C-c m c") 'mc/edit-lines)
  497.   (global-set-key [C-mouse-1] 'mc/add-cursor-on-click)
  498.  
  499.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  500.   ;; Setup Flyspell
  501.  
  502.   ;; Isto e' para habilitar o dicionario em portugues brasileiro
  503.  
  504.   (setq ispell-dictionary "english")
  505.   (setq ispell-alternate-dictionary "brasileiro")
  506.  
  507.   ;(setq ispell-dictionary-alist (list (map 'list  'list (list "brasileiro" "english"))))
  508.   (setq flyspell-issue-message-flag nil)
  509.  
  510.   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  511.   ;; General Shortcuts
  512.  
  513.   ;multiframe window movement
  514.   (global-set-key (kbd "M-n") 'next-multiframe-window)
  515.  
  516.   ;; text movement keybinds
  517.   ;(global-set-key [M-up] 'move-text-up)
  518.   ;(global-set-key [M-down] 'move-text-down)
  519.   (global-set-key [M-up] 'drag-stuff-up)
  520.   (global-set-key [M-down] 'drag-stuff-down)
  521.   (global-set-key [M-left] 'drag-stuff-left)
  522.   (global-set-key [M-right] 'drag-stuff-right)
  523.  
  524.   ;; close and open folds
  525.   (global-set-key (kbd "<backtab>") 'evil-toggle-fold)
  526.  
  527.   ;; zoom controls
  528.   (global-set-key  [C-mouse-4] 'zoom-frm-in)
  529.   (global-set-key  [C-mouse-5] 'zoom-frm-out)
  530.   (global-set-key (kbd "C-+") 'zoom-frm-in)
  531.   (global-set-key (kbd "C--") 'zoom-frm-out)
  532.  
  533.   (global-unset-key (kbd "C-v")) ; remove annoying conflict
  534. )
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
Add Comment
Please, Sign In to add comment